]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
don't use setattachment() on the ice, this way it won't rotate with the player
authorFruitieX <fruitiex@gmail.com>
Tue, 16 Nov 2010 07:57:53 +0000 (09:57 +0200)
committerFruitieX <fruitiex@gmail.com>
Tue, 16 Nov 2010 07:57:53 +0000 (09:57 +0200)
qcsrc/server/mutators/gamemode_freezetag.qc

index 687c9a3f0a7f1cb0b6752f13b96452ab18f61c75..3939ef5b1116b94a1bd077b86be9eb8f3c02e56d 100644 (file)
@@ -50,18 +50,26 @@ void freezetag_CheckWinner()
        next_round = time + 5;
 }
 
        next_round = time + 5;
 }
 
+void freezetag_Ice_Think()
+{
+       setorigin(self, self.owner.origin - '0 0 16');
+       self.nextthink = time;
+}
+
 void freezetag_Freeze()
 {
        self.freezetag_frozen = 1;
 
 void freezetag_Freeze()
 {
        self.freezetag_frozen = 1;
 
-       entity tag;
-       tag = spawn();
-       tag.owner = self;
-       tag.classname = "freezetag_ice";
-       tag.frame = floor(random() * 21); // ice model has 20 different looking frames
-       setmodel(tag, "models/ice/ice.md3");
+       entity ice;
+       ice = spawn();
+       ice.owner = self;
+       ice.classname = "freezetag_ice";
+       ice.think = freezetag_Ice_Think;
+       ice.nextthink = time;
+       ice.frame = floor(random() * 21); // ice model has 20 different looking frames
+       setmodel(ice, "models/ice/ice.md3");
 
 
-       setattachment(tag, self, "");
+       //setattachment(ice, self, "");
 
        self.movetype = MOVETYPE_NONE;
 
 
        self.movetype = MOVETYPE_NONE;
 
@@ -75,10 +83,10 @@ void freezetag_Unfreeze()
        self.movetype = MOVETYPE_WALK;
 
        // remove the ice block
        self.movetype = MOVETYPE_WALK;
 
        // remove the ice block
-       entity tag;
-       for(tag = world; (tag = find(tag, classname, "freezetag_ice")); ) if(tag.owner == self)
+       entity ice;
+       for(ice = world; (ice = find(ice, classname, "freezetag_ice")); ) if(ice.owner == self)
        {
        {
-               remove(tag);
+               remove(ice);
                break;
        }
 }
                break;
        }
 }