Use macro PUT_WEAPON_FLAGS to hide differences in D1X vs D2X

D2X uses a bigger field due to added weapons, but the idea is the same
in both games.
This commit is contained in:
Kp 2013-08-11 15:17:28 +00:00
parent d55054d82e
commit 836aa10f8c
2 changed files with 6 additions and 6 deletions

View file

@ -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];

View file

@ -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];