by randi » Sat Oct 01, 2016 9:35 pm
The self == stateowner check is now
restricted to action functions, so it won't crash Damage functions. The other problem has been
fixed too.
Major Cooke wrote:Using A_SetUserVar, that works from weapons to player.
I don't see why that shouldn't work as described, since it works on self, just like every other function called from a weapon state. Don't consider A_SetUserVar and operator= as equivalent, since they're not. The former is resolved at compile time, and the latter is resolved at runtime.
Vaecrius wrote:Code: Select all
actor zimpball:doomimpball replaces doomimpball{
var int user_blah;
damage(1+user_blah)
states{
spawn:
TNT1 A 0 nodelay{
user_blah=100;
}goto super::spawn
}
}
Looking at the code generated for the spawn state here, I think it should be safe to omit the self==stateowner check for any actors that aren't inventory items, since those are the only ones that could possibly be called with them different.
The self == stateowner check is now [git=944ae2bc09497f52ad6e81354b4f74bc6ece67d5]restricted to action functions[/git], so it won't crash Damage functions. The other problem has been [git=efc9ed2fe9685a448af32065935eb33228c011c3]fixed[/git] too.
[quote="Major Cooke"]Using A_SetUserVar, that works from weapons to player.[/quote]
I don't see why that shouldn't work as described, since it works on self, just like every other function called from a weapon state. Don't consider A_SetUserVar and operator= as equivalent, since they're not. The former is resolved at compile time, and the latter is resolved at runtime.
[quote="Vaecrius"][code]actor zimpball:doomimpball replaces doomimpball{
var int user_blah;
damage(1+user_blah)
states{
spawn:
TNT1 A 0 nodelay{
user_blah=100;
}goto super::spawn
}
}[/code][/quote]
Looking at the code generated for the spawn state here, I think it should be safe to omit the self==stateowner check for any actors that aren't inventory items, since those are the only ones that could possibly be called with them different.