| 1152 | VARP(showmodedescriptions, 0, 1, 1); |
| 1153 | |
| 1154 | void startmap(const char *name, bool reset, bool norespawn) // called just after a map load |
| 1155 | { |
| 1156 | extern bool canceldownloads; |
| 1157 | canceldownloads = false; |
| 1158 | copystring(clientmap, name); |
| 1159 | |
| 1160 | if(norespawn) return; |
| 1161 | |
| 1162 | sendmapidenttoserver = true; |
| 1163 | if(m_botmode) BotManager.BeginMap(name); |
| 1164 | else kickallbots(); |
| 1165 | showmipstats = false; |
| 1166 | clearbounceents(); |
| 1167 | preparectf(!m_flags_); |
| 1168 | suicided = -1; |
| 1169 | spawncycle = -1; |
| 1170 | lasthit = 0; |
| 1171 | if(m_valid(gamemode) && !m_mp(gamemode)) respawnself(); |
| 1172 | else findplayerstart(player1); |
| 1173 | editingsettingsshowminimal = true; // 1st edittoggle shows edithideentmask(!=0); turned off health pickups last session 2 months ago? now you remember! |
| 1174 | |
| 1175 | if(!reset) return; |
| 1176 | |
| 1177 | player1->startmap(); |
| 1178 | loopv(players) if(players[i]) players[i]->startmap(); |
| 1179 | if(editmode) toggleedit(true); |
| 1180 | intermission = false; |
| 1181 | showscores(false); |
| 1182 | closemenu("Download demo"); // close and reset demo list, because it may be no longer accurate, since a new game has started |
| 1183 | extern void *downloaddemomenu; |
| 1184 | menureset(downloaddemomenu); |
| 1185 | needscoresreorder = true; |
| 1186 | minutesremaining = -1; |
| 1187 | lastgametimeupdate = 0; |
| 1188 | arenaintermission = 0; |
| 1189 | ispaused = 0; |
| 1190 | bool noflags = (m_ctf || m_ktf) && !clentstats.hasflags; |
| 1191 | if(*clientmap) conoutf("game mode is \"%s\"%s", modestr(gamemode, modeacronyms > 0), noflags ? " - \f2but there are no flag bases on this map" : ""); |
| 1192 | |
| 1193 | if(showmodedescriptions && (multiplayer(NULL) || m_botmode)) |
| 1194 | { |
| 1195 | loopv(gmdescs) if(gmdescs[i].mode == gamemode) conoutf("\f1%s", gmdescs[i].desc); |
| 1196 | } |
| 1197 | |
| 1198 | // execute mapstart event once |
| 1199 | const char *mapstartonce = getalias("mapstartonce"); |
| 1200 | if(mapstartonce && mapstartonce[0]) |
| 1201 | { |
| 1202 | addsleep(0, mapstartonce); // do this as a sleep to make sure map changes don't recurse inside a welcome packet |
| 1203 | // BTW: in v1.0.4 sleep 1 was required to make it work on initial mapload [flowtron:2010jun25] |
| 1204 | alias("mapstartonce", ""); |
| 1205 | } |
| 1206 | // execute mapstart event |
| 1207 | const char *mapstartalways = getalias("mapstartalways"); |
| 1208 | if(mapstartalways && mapstartalways[0]) |
| 1209 | { |
| 1210 | addsleep(0, mapstartalways); |
| 1211 | } |
no test coverage detected