Fix non-battle trainer script not running properly (#8056)

This commit is contained in:
FosterProgramming 2025-10-30 19:47:22 +01:00 committed by GitHub
parent 3a3b947622
commit 0b005d4b6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -380,6 +380,7 @@ bool8 CheckForTrainersWantingBattle(void)
if (numTrainers == 0xFF) // non-trainerbatle script
{
u32 objectEventId = gApproachingTrainers[gNoOfApproachingTrainers - 1].objectEventId;
gApproachingTrainers[gNoOfApproachingTrainers - 1].trainerScriptPtr = GetObjectEventScriptPointerByObjectEventId(objectEventId);
gSelectedObjectEvent = objectEventId;
gSpecialVar_LastTalked = gObjectEvents[objectEventId].localId;
ScriptContext_SetupScript(EventScript_ObjectApproachPlayer);