Open jekyllgrim opened 1 month ago
shouldn't bISPUFF
and damagesource
be marked as readonly?
shouldn't
bISPUFF
anddamagesource
be marked as readonly?
Since there's no behavior tied to them, right now there's no technical need to do that. But if something gets attached to them in the future, it might be a good idea. Changing them dynamically in ZScript doesn't do anything, so there's no reason not to make them readonly either.
Since there's no behavior tied to them, right now there's no technical need to do that. But if something gets attached to them in the future, it might be a good idea.
Usually it's best to set it early as, once it's freely modifiable, you can't change that without causing potential breakage. It's simpler to go from readonly -> mutable than it is to go from mutable -> readonly. Though frankly I'd argue knowing if something is a puff and where it came from isn't impactful enough to require that kind of guarding. Generally it's only things that have important side effects (e.g. NOBLOCKMAP
) that need to be marked immutable so they can be handled through the proper methods.
Actors that were spawned by
P_SpawnPuff
will receive the newbISPUFF
flag. This also adds adamagesource
field to Actor which stores who fired the puff (similar to PUFFGETSOWNER + target, but unconditionally).P.S. I don't know why but lline 708 kept being marked as changed for me when I added DamageSource to actor.zs. I'm guessing it has something to do with the fact that the comment on line 708 contains an invalid character.