Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions common/game/playercontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,17 @@ void PlayerControl::tickFocus() {
if(!ctrl[Action::ActionGeneric])
return;

auto w = Gothic::inst().world();
auto pl = w!=nullptr ? w->player() : nullptr;
if(pl!=nullptr && pl->interactive()!=nullptr)
return;

auto focus = currentFocus;
if(focus.interactive!=nullptr && interact(*focus.interactive)) {
clearInput();
// vanilla: holding action key uses mobsi again, after quit
if(pl!=nullptr && pl->interactive()==focus.interactive && !focus.interactive->isLadder())
ctrl[Action::ActionGeneric] = true;
}
else if(focus.npc!=nullptr && interact(*focus.npc)) {
clearInput();
Expand Down Expand Up @@ -966,6 +974,12 @@ void PlayerControl::implMoveMobsi(Npc& pl, uint64_t /*dt*/) {
return;
}

// forward at last state - leave mobsi, same as in vanilla
if(ctrl[KeyCodec::Forward] && !inter->isLadder() && inter->isStaticState() && inter->stateId()==inter->stateCount()) {
pl.setInteraction(nullptr);
return;
}

if(inter->needToLockpick(pl) && !inter->isCracked()) {
return;
}
Expand Down