NPCs are stuck in ranged combat stance when loading
Describe the bug As in title NPCc get freezed in the ranged fight after Load Saved Game.
Expected behavior NPCs no longer get stuck in ranged/magic fight after loading a savegame.
Steps to reproduce the issue
- Attack the hero and allow NPC to use ranged weapon.
- Save Game and then Load.
- NPC gets completly freezed for good.
I did not found solution in any patch/mod for G1. It must be deep engine issue.
This is fixed in the Gothic Mod Fix. This part in zs_attack should help
func void ZS_Attack()
{
***
// DEBUG! Загрузка сохранения, сделанного во время атаки с использованием стрелкового оружия или магической атаки.
// В этом случае убирание оружия или деактивация заклинания позволяют избежать зависания в состоянии атаки.
if(!Hlp_IsValidNpc(other))
{
if(Npc_IsInFightMode(self,FMODE_FAR))
{
AI_RemoveWeapon(self);
}
else if(Npc_IsInFightMode(self,FMODE_MAGIC))
{
AI_UnreadySpell(self);
};
};
***
};
@N1kX94 I have tested with Gothic Mod Fix latest version and the bug still occurs. So the code might not help to solve mentioned issue .
If the solution suggested is not working, one could hook the unarchiver function of NPCs to reset the stance.
The first thing here would be to implement an reliable test to check the solution above first.