about summary refs log tree commit diff
path: root/src/game/server/gamecontext.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-09-24 09:03:49 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-09-24 09:03:49 +0000
commiteb21e9d6bb772c6fba533bfe4b421dc7efe181b1 (patch)
tree0d94fb38f7244e2495527d66d8e5ae2c9e155da2 /src/game/server/gamecontext.cpp
parentd9d37b945ee5796553794ef33249c22490494391 (diff)
downloadzcatch-eb21e9d6bb772c6fba533bfe4b421dc7efe181b1.tar.gz
zcatch-eb21e9d6bb772c6fba533bfe4b421dc7efe181b1.zip
cleaned up the code a bit more. pooling of character and player objects with reusable macros. fixed crashing when changing maps and a couple of other bugs
Diffstat (limited to 'src/game/server/gamecontext.cpp')
-rw-r--r--src/game/server/gamecontext.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 7866e0f0..987ce64e 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -7,15 +7,13 @@ GAMECONTEXT game;
 GAMECONTEXT::GAMECONTEXT()
 {
 	for(int i = 0; i < MAX_CLIENTS; i++)
-	{
 		players[i] = 0;
-		/*players = new PLAYER();
-		players[i].init(-1);*/
-	}
 }
 
 GAMECONTEXT::~GAMECONTEXT()
 {
+	for(int i = 0; i < MAX_CLIENTS; i++)
+		delete players[i];
 }
 
 void GAMECONTEXT::clear()
@@ -23,15 +21,6 @@ void GAMECONTEXT::clear()
 	this->~GAMECONTEXT();
 	mem_zero(this, sizeof(*this));
 	new (this) GAMECONTEXT();
-	// reset all players
-	/*
-	for(int i = 0; i < MAX_CLIENTS; i++)
-		players[i].init(-1);
-	
-	world.~GAMEWORLD();
-	mem_zero(&world, sizeof(world));
-	world.GAMEWORLD();
-	*/
 }