gothic-1-community-patch icon indicating copy to clipboard operation
gothic-1-community-patch copied to clipboard

NPCs are stuck in ranged combat stance when loading

Open pawbuj1981 opened this issue 4 years ago • 4 comments

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

  1. Attack the hero and allow NPC to use ranged weapon.
  2. Save Game and then Load.
  3. NPC gets completly freezed for good.

pawbuj1981 avatar Mar 19 '21 12:03 pawbuj1981

I did not found solution in any patch/mod for G1. It must be deep engine issue.

pawbuj1981 avatar Mar 20 '21 16:03 pawbuj1981

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 avatar Apr 01 '21 06:04 N1kX94

@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 .

pawbuj1981 avatar Apr 04 '21 18:04 pawbuj1981

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.

szapp avatar May 13 '21 14:05 szapp