diff --git a/d1x-rebirth/main/multi.c b/d1x-rebirth/main/multi.c index 662ca7080..5789a7d3d 100644 --- a/d1x-rebirth/main/multi.c +++ b/d1x-rebirth/main/multi.c @@ -2415,8 +2415,9 @@ multi_send_player_explode(char type) multibuf[count++] = type; multibuf[count++] = Player_num; - multibuf[count++] = (char)Players[Player_num].primary_weapon_flags; - multibuf[count++] = (char)Players[Player_num].secondary_weapon_flags; +#define PUT_WEAPON_FLAGS(buf,count,value) (buf[count] = value, ++count) + PUT_WEAPON_FLAGS(multibuf, count, Players[Player_num].primary_weapon_flags); + PUT_WEAPON_FLAGS(multibuf, count, Players[Player_num].secondary_weapon_flags); multibuf[count++] = (char)Players[Player_num].laser_level; multibuf[count++] = (char)Players[Player_num].secondary_ammo[HOMING_INDEX]; multibuf[count++] = (char)Players[Player_num].secondary_ammo[CONCUSSION_INDEX]; diff --git a/d2x-rebirth/main/multi.c b/d2x-rebirth/main/multi.c index fd9f1f25c..fdbf2ad3c 100644 --- a/d2x-rebirth/main/multi.c +++ b/d2x-rebirth/main/multi.c @@ -2555,10 +2555,9 @@ multi_send_player_explode(char type) multibuf[count++] = type; multibuf[count++] = Player_num; - PUT_INTEL_SHORT(multibuf+count, Players[Player_num].primary_weapon_flags); - count += 2; - PUT_INTEL_SHORT(multibuf+count, Players[Player_num].secondary_weapon_flags); - count += 2; +#define PUT_WEAPON_FLAGS(buf,count,value) ((PUT_INTEL_SHORT(buf+count, value)), count+=sizeof(uint16_t)) + PUT_WEAPON_FLAGS(multibuf, count, Players[Player_num].primary_weapon_flags); + PUT_WEAPON_FLAGS(multibuf, count, Players[Player_num].secondary_weapon_flags); multibuf[count++] = (char)Players[Player_num].laser_level; multibuf[count++] = (char)Players[Player_num].secondary_ammo[HOMING_INDEX];