summaryrefslogtreecommitdiff
path: root/src/dungeon.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
committerBardur Arantsson <bardur@scientician.net>2015-12-11 08:09:30 +0100
commite07367524c4fb4483057a7d7f983015f66071157 (patch)
tree637b5ec5a9cd9b1d0d0200f39ac77542077de8e2 /src/dungeon.cc
parent33e7dc3baa6b375efb6d8989ffe3c50511291228 (diff)
Allocate p_ptr dynamically
While this technically introduces one-time memory leak, it also lets us avoid the Static Initialization Fiasco problem if we change player_type to a non-POD.
Diffstat (limited to 'src/dungeon.cc')
-rw-r--r--src/dungeon.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dungeon.cc b/src/dungeon.cc
index 62eaf211..9aaf77ed 100644
--- a/src/dungeon.cc
+++ b/src/dungeon.cc
@@ -5122,6 +5122,9 @@ void play_game(bool_ new_game)
bool_ cheat_death = FALSE;
+ /* Initialize player */
+ p_ptr = new player_type();
+
/* Hack -- Character is "icky" */
character_icky = TRUE;