AFX2 TGEA181 Bugs: Resurrected NPCs Not Healing
From AFXWiki
NPCs managed by the NonPlayerWrangler in AFXDemo no longer heal after resurrection via NonPlayerWrangler::resurrectCorpse(). The NPC resurrects fine with health set to half the maximum, but the health stays at that level and does not recover.
This is because RepairRate (and RechargeRate) are set to zero when the NPC dies, otherwise the NPC would immediately resurrect itself by self-healing. Upon resurrection, the NPC's RepairRate needs to be restored. To fix the problem, add the following two lines of code to NonPlayerWrangler::resurrectCorpse() inside afxNonPlayerWrangler.cs near the end of the file:
function NonPlayerWrangler::resurrectCorpse(%this, %corpse)
{
// ...
%corpse.setShapeName(%corpse.path.npcName);
%corpse.setDamageLevel(%corpse.getDatablock().maxDamage*0.5);
// ADD THE FOLLOWING TWO LINES //
%corpse.setRechargeRate(%corpse.getDatablock().rechargeRate);
%corpse.setRepairRate(%corpse.getDatablock().repairRate);
schedule(1000, 0, afxBroadcastTargetStatusbarReset);
}
Note -- This bug is fixed in AFX2 for TGEA 1.8.2.
