Hey,
[EDIT] Nevermind this.
I am using Lehona's DMG_OnDmg script that you can find here:
https://forum.worldofplayers.de/foru...densberechnung
You have this function called when something is damaged by something else:
Code:
func int DMG_OnDmg(var int victimPtr, var int attackerPtr, var int dmg, var int dmgDescriptorPtr)
I'm not sure how the magic that calls that function works, but in that function I can reference the npcs behind those pointers like so:
Code:
Var c_npc vic; vic = _^(victimPtr);
Var c_npc att; att = _^(attackerptr);
This works, att and vic are valid, as long as the pointers are valid. However, if I call another function like so:
Code:
dmg = Handle_Weapon_Dmg(vic, att);
Those C_NPCs are no longer valid in that other function. There is nothing special about the function I am calling:
Code:
func int Handle_Weapon_Dmg(var c_npc vic, var c_npc att)
If I instead pass the pointers and reference the npcs using the _^() operator it works just fine.
What am I missing here? Why are those valid C_NPCs no longer valid when passed to the other function?