src/network/network_data.cpp
changeset 5609 dc6a58930ba4
parent 5587 167d9a91ef02
child 5624 6afe9d27430a
--- a/src/network/network_data.cpp	Thu Jan 11 15:30:35 2007 +0000
+++ b/src/network/network_data.cpp	Thu Jan 11 17:29:39 2007 +0000
@@ -14,8 +14,7 @@
 // Add a command to the local command queue
 void NetworkAddCommandQueue(NetworkClientState *cs, CommandPacket *cp)
 {
-	CommandPacket* new_cp;
-	MallocT(&new_cp, 1);
+	CommandPacket* new_cp = MallocT<CommandPacket>(1);
 
 	*new_cp = *cp;
 
@@ -31,8 +30,7 @@
 // Prepare a DoCommand to be send over the network
 void NetworkSend_Command(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallback *callback)
 {
-	CommandPacket *c;
-	MallocT(&c, 1);
+	CommandPacket *c = MallocT<CommandPacket>(1);
 	byte temp_callback;
 
 	c->player = _local_player;