Properly execute target_changelevel
[voretournament/voretournament.git] / data / qcsrc / server / g_triggers.qc
index ebc63e13d005f8fbe4d70cf1af67cebcc20756fe..92a9cfec3d5e9a9ae04bb78f4f89738a82de8a1c 100644 (file)
@@ -1816,11 +1816,19 @@ void spawnfunc_trigger_magicear()
        //   what to trigger\r
 }\r
 \r
-.string chmap;\r
-void spawnfunc_target_changelevel()\r
+.string chmap, gametype;\r
+void spawnfunc_target_changelevel_use()\r
 {\r
+       if(self.gametype != "")\r
+               MapInfo_SwitchGameType(MapInfo_Type_FromString(self.gametype));\r
+\r
        if (self.chmap == "")\r
                localcmd("endmatch\n");\r
        else\r
                localcmd(strcat("changelevel ", self.chmap, "\n"));\r
 };\r
+\r
+void spawnfunc_target_changelevel()\r
+{\r
+       self.use = spawnfunc_target_changelevel_use;\r
+};\r