REGoth-project / REGoth

OpenSource-Reimplementation of the zEngine, used by the game "Gothic"
GNU General Public License v3.0
631 stars 62 forks source link

Npc_ExchangeRoutine changing the wrong NPC's routine #211

Open PLJohnny opened 7 years ago

PLJohnny commented 7 years ago

This can be best explained with an example:

At the beginning of chapter 2 in Gothic 1 (only playable with my commits from here at the moment), Y'Berion tells the Hero to go and find Nyras, who was responsible for retrieving the focus stone from the hill above the camp. "B_Story_BringFirstFocus()" is called in Y'Berion's script.

The following lines can be found inside it:

var C_NPC nyras; nyras = Hlp_GetNpc (Nov_1303_Nyras); Npc_ExchangeRoutine (nyras, "PrepareRitual"); AI_ContinueRoutine (nyras);

But the log says this: "Info: Changed routine on Nyras to: ZS_SMALLTALK"

Moreover, it's Y'Berion who starts running towards the focus stone location waypoint after ending the dialogue.

markusobi commented 7 years ago

Bug: void PlayerController::setRoutineFunc(size_t symRoutine) sets (ok) and starts (not ok) the routine via m_AIStateMachine.reinitRoutine(); which it shouldn't. AI_ContinueRoutine should do this instead (currently unimplemented)

ataulien commented 7 years ago

Is this fixed by now? I remember something about this...