fix laser telegun through TELEINWEAPON tile

This commit is contained in:
Ryozuki 2018-11-10 20:47:11 +01:00
parent 62dbda204e
commit 41fc33406a

View file

@ -201,27 +201,31 @@ void CLaser::DoBounce()
int TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex); int TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex);
bool IsSwitchTeleGun = GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ALLOW_TELE_GUN; bool IsSwitchTeleGun = GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ALLOW_TELE_GUN;
bool IsBlueSwitchTeleGun = GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ALLOW_BLUE_TELE_GUN; bool IsBlueSwitchTeleGun = GameServer()->Collision()->IsSwitch(MapIndex) == TILE_ALLOW_BLUE_TELE_GUN;
int IsTeleInWeapon = GameServer()->Collision()->IsTeleportWeapon(MapIndex);
if(IsSwitchTeleGun || IsBlueSwitchTeleGun) { if(!IsTeleInWeapon)
// Delay specifies which weapon the tile should work for. {
// Delay = 0 means all. if(IsSwitchTeleGun || IsBlueSwitchTeleGun) {
int delay = GameServer()->Collision()->GetSwitchDelay(MapIndex); // Delay specifies which weapon the tile should work for.
// Delay = 0 means all.
int delay = GameServer()->Collision()->GetSwitchDelay(MapIndex);
if((delay != 3 && delay != 0) && m_Type == WEAPON_RIFLE) { if((delay != 3 && delay != 0) && m_Type == WEAPON_RIFLE) {
IsSwitchTeleGun = IsBlueSwitchTeleGun = false; IsSwitchTeleGun = IsBlueSwitchTeleGun = false;
}
} }
m_IsBlueTeleport = TileFIndex == TILE_ALLOW_BLUE_TELE_GUN || IsBlueSwitchTeleGun;
// Teleport is canceled if the last bounce tile is not a TILE_ALLOW_TELE_GUN.
// Teleport also works if laser didn't bounce.
m_TeleportCancelled =
m_Type == WEAPON_RIFLE
&& (TileFIndex != TILE_ALLOW_TELE_GUN
&& TileFIndex != TILE_ALLOW_BLUE_TELE_GUN
&& !IsSwitchTeleGun
&& !IsBlueSwitchTeleGun);
} }
m_IsBlueTeleport = TileFIndex == TILE_ALLOW_BLUE_TELE_GUN || IsBlueSwitchTeleGun;
// Teleport is canceled if the last bounce tile is not a TILE_ALLOW_TELE_GUN.
// Teleport also works if laser didn't bounce.
m_TeleportCancelled =
m_Type == WEAPON_RIFLE
&& (TileFIndex != TILE_ALLOW_TELE_GUN
&& TileFIndex != TILE_ALLOW_BLUE_TELE_GUN
&& !IsSwitchTeleGun
&& !IsBlueSwitchTeleGun);
} }
//m_Owner = -1; //m_Owner = -1;