@@ -176,19 +176,6 @@ void PlayerControl::onKeyReleased(KeyCodec::Action a) {
176176 } else {
177177 std::memset (actrl,0 ,sizeof (actrl));
178178 }
179-
180- if (pl!=nullptr && pl->interactive ()!=nullptr ) {
181- auto inter = pl->interactive ();
182- if (inter->isLadder ()) {
183- bool g1c=Gothic::inst ().settingsGetI (" GAME" ," USEGOTHIC1CONTROLS" )!=0 ;
184- if (a==KeyCodec::ActionGeneric && !g1c) {
185- inter->nextState (*pl,4 );
186- return ;
187- }
188- if ((a==KeyCodec::Forward || a==KeyCodec::Back) && (g1c || (!g1c && isPressed (KeyCodec::ActionGeneric))))
189- inter->nextState (*pl,0 );
190- }
191- }
192179 }
193180
194181bool PlayerControl::isPressed (KeyCodec::Action a) const {
@@ -209,13 +196,12 @@ void PlayerControl::tickFocus() {
209196 currentFocus = findFocus (¤tFocus);
210197 setTarget (currentFocus.npc );
211198
212- if (!ctrl[Action::ActionGeneric] || Gothic::inst (). world ()-> player ()-> interactive ()!= nullptr )
199+ if (!ctrl[Action::ActionGeneric])
213200 return ;
214201
215202 auto focus = currentFocus;
216203 if (focus.interactive !=nullptr && interact (*focus.interactive )) {
217- if (!focus.interactive ->isLadder ())
218- clearInput ();
204+ clearInput ();
219205 }
220206 else if (focus.npc !=nullptr && interact (*focus.npc )) {
221207 clearInput ();
@@ -812,10 +798,9 @@ void PlayerControl::implMoveMobsi(Npc& pl, uint64_t /*dt*/) {
812798 }
813799
814800 if (inter->isStaticState () && !inter->isDetachState (pl)) {
815- auto stateId=inter->stateId ();
816- bool ladder=inter->isLadder () && stateId==inter->stateCount ();
817- if (inter->canQuitAtState (pl,stateId-ladder))
818- pl.setInteraction (nullptr ,ladder);
801+ if (inter->canQuitAtState (pl,inter->stateId ())) {
802+ pl.setInteraction (nullptr ,false );
803+ }
819804 }
820805 }
821806
@@ -870,31 +855,13 @@ void PlayerControl::processPickLock(Npc& pl, Interactive& inter, KeyCodec::Actio
870855 }
871856
872857void PlayerControl::processLadder (Npc& pl, Interactive& inter, KeyCodec::Action key) {
873- bool g1c=Gothic::inst ().settingsGetI (" GAME" ," USEGOTHIC1CONTROLS" )!=0 ;
874-
875- if (key==KeyCodec::ActionGeneric) {
876- ctrl[key] = true ;
877- if (g1c) {
878- pl.stopAnim (" " );
879- pl.setInteraction (nullptr );
880- ctrl[key] = false ;
881- }
882- else {
883- inter.nextState (pl,0 );
884- }
885- return ;
886- }
887- if (!g1c && !isPressed (KeyCodec::ActionGeneric))
888- return ;
889- if (key==KeyCodec::Forward ) {
890- inter.nextState (pl,1 );
858+ if (key==KeyCodec::Back) {
859+ pl.setInteraction (nullptr );
891860 return ;
892861 }
893- if (key==KeyCodec::Back) {
894- if (g1c)
895- inter.nextState (pl,2 );
896- else
897- inter.nextState (pl,3 );
862+
863+ if (key==KeyCodec::Forward) {
864+ inter.nextState (pl);
898865 }
899866 }
900867
0 commit comments