Page 1 of 1

callbackOnTakeDamage

Posted: Sat Nov 22, 2014 11:37 pm
by HousePet
If you return {dam=0, stopped=true} for example from the callback, DamageType.defaultProjector returns true.
Should you be blocking fire or cold or similar damage, this causes lua errors due to the game then comparing the returned value with 0.
eg.

Code: Select all

local realdam = DamageType.defaultProjector(src, x, y, type, dam)
if realdam > 0 then
I'll stop using the stopped flag for now, but it doesn't seem to be working as intended?

Re: callbackOnTakeDamage

Posted: Mon Nov 24, 2014 12:38 am
by StarKeep
Hum, I thought you were supposed change data.stopped into a number value, and not just true. Was I mistaken?

I was under the impression that if 'stopped' is set to anything, it returns it instead.
So my thinking was that if it is returned in the same way that dam, a number value, is returned, should it not also be a number?

Re: callbackOnTakeDamage

Posted: Mon Nov 24, 2014 6:57 am
by HousePet
I might have misinterpreted the use.