- Joined
- Jan 9, 2005
- Messages
- 2,126
I have a little problem with lightning effect on slopes that was not connecting with a unit even tho I set it's Z height to the same as the unit it's emitting from. I was told I had to adjust for GetLocationZ, which I did, but now I think it's leaking a location variable. I would like to avoid having to use any location variables if necessary and deal strictly with reals. can anyone help? Here's my current code:
z1 and z2 are the flying heights of udg_BeamCaster[ID] and udg_BeamMover[ID] respectively.
This works as intended, but yeah, possible leak + not wanting to use locations. This event is supposed to repeat every 0.3125 seconds, multiple times. So the least overhead is the most preferred.
call MoveLightningEx(udg_BeamLightning[ID], true, GetUnitX(udg_BeamCaster[ID]), GetUnitY(udg_BeamCaster[ID]), GetLocationZ(GetUnitLoc(udg_BeamCaster[ID])) + z1, GetUnitX(udg_BeamMover[ID]), GetUnitY(udg_BeamMover[ID]), GetLocationZ(GetUnitLoc(udg_BeamMover[ID])) + z2)
z1 and z2 are the flying heights of udg_BeamCaster[ID] and udg_BeamMover[ID] respectively.
This works as intended, but yeah, possible leak + not wanting to use locations. This event is supposed to repeat every 0.3125 seconds, multiple times. So the least overhead is the most preferred.