]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_tdm.qc
Hacky fix for TDM crashing
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_tdm.qc
index d391f11b23c6232d72ac6640e5d144167bd31cc8..0d516b262623c6f5489d665977ed68c34b7f312a 100644 (file)
@@ -13,7 +13,7 @@ REGISTER_MUTATOR(tdm, false)
        {
                if (time > 1) // game loads at time 1
                        error("This is a game type and it cannot be added at runtime.");
-               InitializeEntity(world, tdm_DelayedInit, INITPRIO_GAMETYPE);
+               InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
 
                ActivateTeamplay();
                SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, autocvar_timelimit_override, -1);
@@ -60,17 +60,18 @@ spawnfunc(tdm_team)
 // code from here on is just to support maps that don't have team entities
 void tdm_SpawnTeam (string teamname, float teamcolor)
 {
-       entity this = new(tdm_team);
+       entity this = new_pure(tdm_team);
        this.netname = teamname;
        this.cnt = teamcolor;
+       this.team = this.cnt + 1;
        this.spawnfunc_checked = true;
-       WITHSELF(this, spawnfunc_tdm_team(this));
+       //spawnfunc_tdm_team(this);
 }
 
 void tdm_DelayedInit(entity this)
 {
        // if no teams are found, spawn defaults
-       if(find(world, classname, "tdm_team") == world)
+       if(find(NULL, classname, "tdm_team") == NULL)
        {
                LOG_TRACE("No \"tdm_team\" entities found on this map, creating them anyway.\n");
 
@@ -87,7 +88,7 @@ void tdm_DelayedInit(entity this)
 
 MUTATOR_HOOKFUNCTION(tdm, GetTeamCount, CBC_ORDER_EXCLUSIVE)
 {
-       ret_string = "tdm_team";
+       M_ARGV(1, string) = "tdm_team";
        return true;
 }