]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/breakable.qc
Merge branch 'master' into terencehill/hud_shake_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / breakable.qc
index 25857be3a1f48d659bc35a0f1a1c2a6467a845bc..1a65710a98346fcd1115b60ca06887e6282b7f87 100644 (file)
@@ -104,7 +104,7 @@ void func_breakable_look_destroyed(entity this)
        else {
                if (this.origin == '0 0 0')     {       // probably no origin brush, so don't spawn in the middle of the map..
                        floorZ = this.absmin.z;
-                       setorigin(this,((this.absmax+this.absmin)*.5));
+                       setorigin(this, ((this.absmax + this.absmin) * 0.5));
                        this.origin_z = floorZ;
                }
                _setmodel(this, this.mdl_dead);
@@ -164,12 +164,12 @@ void func_breakable_behave_restore(entity this)
                _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
 }
 
-void func_breakable_init_for_player(entity player)
-{SELFPARAM();
-       if (self.noise1 && self.state == 0 && clienttype(player) == CLIENTTYPE_REAL)
+void func_breakable_init_for_player(entity this, entity player)
+{
+       if (this.noise1 && this.state == 0 && clienttype(player) == CLIENTTYPE_REAL)
        {
                msg_entity = player;
-               soundto (MSG_ONE, self, CH_TRIGGER_SINGLE, self.noise1, VOL_BASE, ATTEN_NORM);
+               soundto (MSG_ONE, this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
        }
 }
 
@@ -189,8 +189,8 @@ void func_breakable_restore(entity this, entity actor, entity trigger)
        CSQCMODEL_AUTOUPDATE(this);
 }
 
-void func_breakable_restore_self()
-{SELFPARAM();
+void func_breakable_restore_self(entity this)
+{
        func_breakable_restore(this, NULL, NULL);
 }
 
@@ -201,7 +201,7 @@ void func_breakable_destroy(entity this, entity actor, entity trigger)
        string oldmsg;
 
        entity act = this.owner;
-       this.owner = world; // set by W_PrepareExplosionByDamage
+       this.owner = NULL; // set by W_PrepareExplosionByDamage
 
        // now throw around the debris
        n = tokenize_console(this.debris);
@@ -214,14 +214,14 @@ void func_breakable_destroy(entity this, entity actor, entity trigger)
                _sound (this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
 
        if(this.dmg)
-               RadiusDamage(this, act, this.dmg, this.dmg_edge, this.dmg_radius, this, world, this.dmg_force, DEATH_HURTTRIGGER.m_id, world);
+               RadiusDamage(this, act, this.dmg, this.dmg_edge, this.dmg_radius, this, NULL, this.dmg_force, DEATH_HURTTRIGGER.m_id, NULL);
 
        if(this.cnt) // TODO
                __pointparticles(this.cnt, this.absmin * 0.5 + this.absmax * 0.5, '0 0 0', this.count);
 
        if(this.respawntime)
        {
-               this.think = func_breakable_restore_self;
+               setthink(this, func_breakable_restore_self);
                this.nextthink = time + this.respawntime + crandom() * this.respawntimejitter;
        }
 
@@ -231,8 +231,8 @@ void func_breakable_destroy(entity this, entity actor, entity trigger)
        this.message = oldmsg;
 }
 
-void func_breakable_destroy_self()
-{SELFPARAM();
+void func_breakable_destroy_self(entity this)
+{
        func_breakable_destroy(this, NULL, NULL);
 }
 
@@ -271,7 +271,7 @@ void func_breakable_damage(entity this, entity inflictor, entity attacker, float
                // do not explode NOW but in the NEXT FRAME!
                // because recursive calls to RadiusDamage are not allowed
                this.nextthink = time;
-               this.think = func_breakable_destroy_self;
+               setthink(this, func_breakable_destroy_self);
        }
 }
 
@@ -319,7 +319,7 @@ spawnfunc(func_breakable)
                this.dmg_force = 200;
 
        this.mdl = this.model;
-       SetBrushEntityModel();
+       SetBrushEntityModel(this);
 
        if(this.spawnflags & 4)
                this.use = func_breakable_destroy;