yogstation13 / yogstation-classic

Yogstation13's classic code source.
http://www.yogstation.net
GNU Affero General Public License v3.0
12 stars 37 forks source link

Fixed fireball not working when critted while holding it #1227

Closed X-TheDark closed 8 years ago

X-TheDark commented 8 years ago

Refer to issue #1219 .

Intent of your Pull Request

One of the most peculiar and interesting bugs I had to fix.

Cause: Basically, if we dropped the fireball due to crit-damage, somewhere down the proc call stack usr (BYOND built-in var) started returning null, which caused line 83 var/obj/effect/fire_ball/F = new(get_turf(usr)) (before fix) to create the fireball (the thing that gets created when you drop/throw the thing you hold in hand) in null-space, fucking everything up. This also applied to invocation(), that also needed to have user passed explicitly, rather than using usr.

One of the best showcases of the big bold text from http://www.byond.com/docs/ref/info.html#/proc/var/usr

Fix: Explicitly pass the user to the proc, instead of using usr inside it. Fixes both fireball not triggering and it not being able to recharge ever.

Changelog

:cl: X-TheDark bugfix: Fireball now correctly triggers when the holder drops it due to crit-damage. /:cl:

oisin100 commented 8 years ago

Interesting...