]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
Merge branch 'TimePath/killself' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_keyhunt.qc
index 8886753aab53351e872be82c2ff7fde1407a92de..4d65abf9e0b7a98ae7793cea950dc123750fc5dc 100644 (file)
@@ -215,12 +215,12 @@ void kh_Controller_SetThink(float t, kh_Think_t func)  // runs occasionaly
                kh_controller.nextthink = time; // force
 }
 void kh_WaitForPlayers();
-void kh_Controller_Think()  // called a lot
-{SELFPARAM();
+void kh_Controller_Think(entity this)  // called a lot
+{
        if(intermission_running)
                return;
        if(self.cnt > 0)
-       { if(self.think != kh_WaitForPlayers) { self.cnt -= 1; } }
+       { if(getthink(self) != kh_WaitForPlayers) { self.cnt -= 1; } }
        else if(self.cnt == 0)
        {
                self.cnt -= 1;
@@ -505,8 +505,8 @@ void kh_Key_Collect(entity key, entity player)  //a player picks up a dropped ke
        kh_Key_AssignTo(key, player); // this also updates .kh_state
 }
 
-void kh_Key_Touch()  // runs many, many times when a key has been dropped and can be picked up
-{SELFPARAM();
+void kh_Key_Touch(entity this)  // runs many, many times when a key has been dropped and can be picked up
+{
        if(intermission_running)
                return;
 
@@ -726,8 +726,8 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
        kh_FinishRound();
 }
 
-void kh_Key_Think()  // runs all the time
-{SELFPARAM();
+void kh_Key_Think(entity this)  // runs all the time
+{
        if(intermission_running)
                return;
 
@@ -793,7 +793,7 @@ void kh_Key_Spawn(entity initial_owner, float _angle, float i)  // runs every ti
        key.count = i;
        key.classname = STR_ITEM_KH_KEY;
        settouch(key, kh_Key_Touch);
-       key.think = kh_Key_Think;
+       setthink(key, kh_Key_Think);
        key.nextthink = time;
        key.items = IT_KEY1 | IT_KEY2;
        key.cnt = _angle;
@@ -1058,7 +1058,7 @@ void kh_Initialize()  // sets up th KH environment
 
        // make a KH entity for controlling the game
        kh_controller = spawn();
-       kh_controller.think = kh_Controller_Think;
+       setthink(kh_controller, kh_Controller_Think);
        kh_Controller_SetThink(0, kh_WaitForPlayers);
 
        setmodel(kh_controller, MDL_KH_KEY);