- add Level parameter to G_LeavingHub

This commit is contained in:
Christoph Oelckers 2019-01-29 02:08:53 +01:00
parent f9239f6e0f
commit 87859b2950
3 changed files with 11 additions and 11 deletions

View file

@ -76,7 +76,7 @@ struct FHubInfo
static TArray<FHubInfo> hubdata; static TArray<FHubInfo> hubdata;
void G_LeavingHub(int mode, cluster_info_t * cluster, wbstartstruct_t * wbs) void G_LeavingHub(FLevelLocals *Level, int mode, cluster_info_t * cluster, wbstartstruct_t * wbs)
{ {
unsigned int i, j; unsigned int i, j;
@ -84,7 +84,7 @@ void G_LeavingHub(int mode, cluster_info_t * cluster, wbstartstruct_t * wbs)
{ {
for (i = 0; i < hubdata.Size(); i++) for (i = 0; i < hubdata.Size(); i++)
{ {
if (hubdata[i].levelnum == level.levelnum) if (hubdata[i].levelnum == Level->levelnum)
{ {
hubdata[i] = *wbs; hubdata[i] = *wbs;
break; break;
@ -95,13 +95,13 @@ void G_LeavingHub(int mode, cluster_info_t * cluster, wbstartstruct_t * wbs)
hubdata[hubdata.Reserve(1)] = *wbs; hubdata[hubdata.Reserve(1)] = *wbs;
} }
hubdata[i].levelnum = level.levelnum; hubdata[i].levelnum = Level->levelnum;
if (!multiplayer && !deathmatch) if (!multiplayer && !deathmatch)
{ {
// The player counters don't work in hubs // The player counters don't work in hubs
hubdata[i].plyr[0].skills = level.killed_monsters; hubdata[i].plyr[0].skills = Level->killed_monsters;
hubdata[i].plyr[0].sitems = level.found_items; hubdata[i].plyr[0].sitems = Level->found_items;
hubdata[i].plyr[0].ssecret = level.found_secrets; hubdata[i].plyr[0].ssecret = Level->found_secrets;
} }
@ -129,11 +129,11 @@ void G_LeavingHub(int mode, cluster_info_t * cluster, wbstartstruct_t * wbs)
{ {
if (cluster->flags & CLUSTER_LOOKUPNAME) if (cluster->flags & CLUSTER_LOOKUPNAME)
{ {
level.LevelName = GStrings(cluster->ClusterName); Level->LevelName = GStrings(cluster->ClusterName);
} }
else else
{ {
level.LevelName = cluster->ClusterName; Level->LevelName = cluster->ClusterName;
} }
} }
} }
@ -185,4 +185,4 @@ void G_SerializeHub(FSerializer &arc)
void G_ClearHubInfo() void G_ClearHubInfo()
{ {
hubdata.Clear(); hubdata.Clear();
} }

View file

@ -6,7 +6,7 @@ struct wbstartstruct_t;
class FSerializer; class FSerializer;
void G_SerializeHub (FSerializer &file); void G_SerializeHub (FSerializer &file);
void G_LeavingHub(int mode, cluster_info_t * cluster, struct wbstartstruct_t * wbs); void G_LeavingHub(FLevelLocals *Level, int mode, cluster_info_t * cluster, struct wbstartstruct_t * wbs);
#endif #endif

View file

@ -855,7 +855,7 @@ void G_DoCompleted (void)
} }
// Intermission stats for entire hubs // Intermission stats for entire hubs
G_LeavingHub(mode, thiscluster, &wminfo); G_LeavingHub(&level, mode, thiscluster, &wminfo);
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {