]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
target_give: support shield and strength powerups
authorbones_was_here <bones_was_here@yahoo.com.au>
Wed, 12 Aug 2020 06:28:49 +0000 (16:28 +1000)
committerbones_was_here <bones_was_here@yahoo.com.au>
Wed, 12 Aug 2020 06:28:49 +0000 (16:28 +1000)
qcsrc/server/compat/quake3.qc

index 7e1829c9cf256eeaf6ebf7196111d424d0b2def3..a68cc8a339c987a3822617b78b5458e900164531 100644 (file)
@@ -241,10 +241,18 @@ void target_give_init(entity this)
                        this.netname = cons(this.netname, buff.netname);
                        STAT(BUFF_TIME, this) = it.count;
                }
+               else if (it.classname == "item_shield") {
+                       this.invincible_finished = it.count;
+                       this.netname = cons(this.netname, "invincible");
+               }
+               else if (it.classname == "item_strength") {
+                       this.strength_finished = it.count;
+                       this.netname = cons(this.netname, "strength");
+               }
 
                //remove(it); // removing ents in init functions causes havoc, workaround:
-        setthink(it, SUB_Remove);
-        it.nextthink = time;
+               setthink(it, SUB_Remove);
+               it.nextthink = time;
        });
        this.spawnflags = 2;
        this.spawnfunc_checked = true;