Skip to content

Commit

Permalink
Fix shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Nov 23, 2024
1 parent b26a146 commit b61b47d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/cdogs/map_wolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3543,11 +3543,11 @@ static bool TryLoadCampaign(CampaignList *list, const char *path)
}

void MapWolfN3DCheckAndLoadCustomQuiz(
const Campaign *c, const CArray *playerDatas)
const char *title, const CArray *playerDatas)
{
// Special case for N3D: Epic of Gilgamesh quiz easter egg
// This code is pretty cursed
if (strcmp(c->Setting.Title, "Super 2D Noah's Ark") != 0)
if (strcmp(title, "Super 2D Noah's Ark") != 0)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cdogs/map_wolf.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ int MapWolfLoad(
void MapWolfLoadCampaignsFromSystem(CampaignList *list);

void MapWolfN3DCheckAndLoadCustomQuiz(
const Campaign *c, const CArray *playerDatas);
const char *title, const CArray *playerDatas);
19 changes: 11 additions & 8 deletions src/prep.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ static void PlayerSelectionOnExit(GameLoopData *data)
{
gCampaign.MissionIndex = 0;
}
MapWolfN3DCheckAndLoadCustomQuiz(&gCampaign, &gPlayerDatas);
MapWolfN3DCheckAndLoadCustomQuiz(
gCampaign.Setting.Title, &gPlayerDatas);
}
else
{
Expand Down Expand Up @@ -393,13 +394,13 @@ static GameLoopResult PlayerSelectionUpdate(GameLoopData *data, LoopRunner *l)
LoopRunnerPop(l);
return UPDATE_RESULT_OK;
}

int idx = 0;
if (pData->endCounter == 0)
{
// Menu input
const int localHumanPlayers = GetNumPlayers(PLAYER_ANY, true, true);
const bool useMenuCmd = (localHumanPlayers <= 1);
const int localHumanPlayers = GetNumPlayers(PLAYER_ANY, true, true);
const bool useMenuCmd = (localHumanPlayers <= 1);
for (int i = 0; i < (int)gPlayerDatas.size; i++, idx++)
{
const PlayerData *p = CArrayGet(&gPlayerDatas, i);
Expand All @@ -414,13 +415,13 @@ static GameLoopResult PlayerSelectionUpdate(GameLoopData *data, LoopRunner *l)
if (ms->current->customPostUpdateFunc)
{
ms->current->customPostUpdateFunc(
ms->current, ms->current->customPostUpdateData);
ms->current, ms->current->customPostUpdateData);
}
MenuUpdateMouse(ms);
if (useMenuCmd)
{
cmds[idx] |=
GetMenuCmd(&gEventHandlers, ms->current->mouseHover);
GetMenuCmd(&gEventHandlers, ms->current->mouseHover);
}
if (!MenuIsExit(ms) && cmds[idx])
{
Expand Down Expand Up @@ -467,11 +468,13 @@ static GameLoopResult PlayerSelectionUpdate(GameLoopData *data, LoopRunner *l)
idx--;
continue;
}
if (p->inputDevice == INPUT_DEVICE_UNSET || p->inputDevice == INPUT_DEVICE_AI)
if (p->inputDevice == INPUT_DEVICE_UNSET ||
p->inputDevice == INPUT_DEVICE_AI)
{
hasAIPlayers = true;
PlayerTrySetInputDevice(p, INPUT_DEVICE_AI, 0);
pData->menus[idx].ms.current = MenuGetSubmenuByName(pData->menus[idx].ms.root, "Done");
pData->menus[idx].ms.current =
MenuGetSubmenuByName(pData->menus[idx].ms.root, "Done");
}
}
if (hasAIPlayers && pData->endCounter < 70)
Expand Down

0 comments on commit b61b47d

Please sign in to comment.