From b935797f21abb7e6c325770fabd420ad91c01768 Mon Sep 17 00:00:00 2001 From: Kp Date: Tue, 4 Nov 2014 01:06:47 +0000 Subject: [PATCH] Use array<> for multi remote_to_local, local_to_remote --- similar/main/multi.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/similar/main/multi.cpp b/similar/main/multi.cpp index 601c781f7..b18290cf9 100644 --- a/similar/main/multi.cpp +++ b/similar/main/multi.cpp @@ -121,8 +121,6 @@ fix Show_kill_list_timer = 0; int PhallicLimit=0; int PhallicMan=-1; -int SoundHacked=0; -digi_sound ReversedSound; char Multi_is_guided=0; #endif int Bounty_target = 0; @@ -134,8 +132,8 @@ int multi_message_index = 0; ubyte multibuf[MAX_MULTI_MESSAGE_LEN+4]; // This is where multiplayer message are built -static short remote_to_local[MAX_PLAYERS][MAX_OBJECTS]; // Remote object number for each local object -static short local_to_remote[MAX_OBJECTS]; +static array, MAX_PLAYERS> remote_to_local; // Remote object number for each local object +static array local_to_remote; sbyte object_owner[MAX_OBJECTS]; // Who created each object in my universe, -1 = loaded at start objnum_t Net_create_objnums[MAX_NET_CREATE_OBJECTS]; // For tracking object creation that will be sent to remote @@ -335,8 +333,9 @@ void map_objnum_local_to_local(objnum_t local_objnum) void reset_network_objects() { - memset(local_to_remote, -1, MAX_OBJECTS*sizeof(short)); - memset(remote_to_local, -1, MAX_PLAYERS*MAX_OBJECTS*sizeof(short)); + local_to_remote.fill(-1); + range_for (auto &i, remote_to_local) + i.fill(object_none); memset(object_owner, -1, MAX_OBJECTS); }