mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Fix incorrect map name and spawnpoint when a spawnpoint ('$') is specified, causing crash
This commit is contained in:
parent
393dfae33e
commit
e7cddd47a5
1 changed files with 5 additions and 5 deletions
|
@ -1511,9 +1511,9 @@ void Level::ServerSpawned(void)
|
|||
|
||||
void Level::SetMap(const char *themapname)
|
||||
{
|
||||
char *spawnpos;
|
||||
int i;
|
||||
str text;
|
||||
const char *spawnpos;
|
||||
int i;
|
||||
str text;
|
||||
|
||||
Init();
|
||||
|
||||
|
@ -1522,8 +1522,8 @@ void Level::SetMap(const char *themapname)
|
|||
// set a specific spawnpoint if the map was started with a $
|
||||
spawnpos = strchr((char *)themapname, '$');
|
||||
if (spawnpos) {
|
||||
mapname = (const char *)(spawnpos - themapname);
|
||||
spawnpoint = mapname;
|
||||
mapname = str(themapname, 0, spawnpos - themapname);
|
||||
spawnpoint = spawnpos + 1;
|
||||
} else {
|
||||
mapname = themapname;
|
||||
spawnpoint = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue