Skip to content

Commit

Permalink
Solve circular header dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Jan 19, 2025
1 parent 3f2a668 commit 1a7d514
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include "pfile.h"
#include "playerdat.hpp"
#include "plrmsg.h"
#include "portal.h"
#include "qol/chatlog.h"
#include "qol/floatingnumbers.h"
#include "qol/itemlabels.h"
Expand Down
1 change: 1 addition & 0 deletions Source/interfac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "multi.h"
#include "pfile.h"
#include "plrmsg.h"
#include "portal.h"
#include "utils/log.hpp"
#include "utils/sdl_geometry.h"
#include "utils/sdl_thread.h"
Expand Down
1 change: 1 addition & 0 deletions Source/loadsave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "mpq/mpq_common.hpp"
#include "pfile.h"
#include "playerdat.hpp"
#include "portal.h"
#include "qol/stash.h"
#include "stores.h"
#include "utils/algorithm/container.hpp"
Expand Down
1 change: 1 addition & 0 deletions Source/msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "pack.h"
#include "pfile.h"
#include "plrmsg.h"
#include "portal.h"
#include "spells.h"
#include "storm/storm_net.hpp"
#include "sync.h"
Expand Down
1 change: 0 additions & 1 deletion Source/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "items.h"
#include "monster.h"
#include "objects.h"
#include "portal.h"
#include "quests.h"

namespace devilution {
Expand Down
1 change: 1 addition & 0 deletions Source/multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "options.h"
#include "pfile.h"
#include "plrmsg.h"
#include "portal.h"
#include "qol/chatlog.h"
#include "storm/storm_net.hpp"
#include "sync.h"
Expand Down
1 change: 1 addition & 0 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "objects.h"
#include "options.h"
#include "player.h"
#include "portal.h"
#include "qol/autopickup.h"
#include "qol/floatingnumbers.h"
#include "qol/stash.h"
Expand Down
4 changes: 2 additions & 2 deletions Source/portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
namespace devilution {

/** In-game state of portals. */
Portal Portals[8];
Portal Portals[MaxPlayers];

namespace {

/** Current portal number (a portal array index). */
size_t portalindex;

/** Coordinate of each player's portal in town. */
Point PortalTownPosition[8] = {
Point PortalTownPosition[MaxPlayers] = {
{ 57, 40 },
{ 59, 40 },
{ 61, 40 },
Expand Down
3 changes: 2 additions & 1 deletion Source/portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "engine/point.hpp"
#include "levels/gendung.h"
#include "multi.h"

namespace devilution {

Expand All @@ -21,7 +22,7 @@ struct Portal {
bool setlvl;
};

extern Portal Portals[8];
extern Portal Portals[MaxPlayers];

void InitPortals();
void SetPortalStats(int i, bool o, Point position, int lvl, dungeon_type lvltype, bool isSetLevel);
Expand Down

0 comments on commit 1a7d514

Please sign in to comment.