Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
the small kremfixes thread
#2
another small kremfix for you

thanks to mbc for this fix:

Quote:mbc: ok suggestion kremlin
[9:20 PM] mbc: i'm pretty sure that playsound uses LAGCHECK() somewhere
[9:20 PM] mbc: in other words, it contains a sleep() call
[9:20 PM] kremlin: ahahahah
[9:20 PM] mbc: creating a race condition on P.shooter = shooter
[9:21 PM] kremlin: yeah
[9:21 PM] mbc: so you should move the playsound to the bottom of that proc
[9:21 PM] kremlin: well
[9:21 PM] kremlin: i can sure do that but
[9:21 PM] kremlin: i can't trigger the condition to test anyways
[9:21 PM] mbc: or i mean... we should do that


Code:
diff --git a/code/datums/projectiles/projectile_parent.dm b/code/datums/projectiles/projectile_parent.dm
index a25c9f0..574fc78 100644
--- a/code/datums/projectiles/projectile_parent.dm
+++ b/code/datums/projectiles/projectile_parent.dm
@@ -697,6 +697,8 @@ datum/projectile/snowball

        P.set_loc(S)
        P.proj_data = DATA
+       P.shooter = shooter
+       P.name = DATA.name

        if (narrator_mode)
                playsound(S, 'sound/vox/shoot.ogg', 50, 1)
@@ -715,8 +717,6 @@ datum/projectile/snowball
                P.implanted = DATA.implanted

        P.set_icon()
-       P.shooter = shooter
-       P.name = DATA.name
        P.setMaterial(DATA.material)
        P.power = DATA.power

@@ -777,4 +777,4 @@ datum/projectile/snowball
                Q.mob_shooter = P.shooter
        Q.name = "reflected [Q.name]"
        Q.launch()
-       return Q
\ No newline at end of file
+       return Q

this fixes pods shooting themselves (Maybe)
Reply


Messages In This Thread
the small kremfixes thread - by kremlin - 01-04-2018, 02:37 PM
RE: the small kremfixes thread - by kremlin - 01-05-2018, 06:26 AM
RE: the small kremfixes thread - by Cyfarfod - 01-06-2018, 03:25 AM
RE: the small kremfixes thread - by Mordent - 01-25-2018, 06:09 PM
RE: the small kremfixes thread - by ZeWaka - 01-26-2018, 06:27 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)