1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-28 07:07:45 +00:00

Gm invis is less of a hack

This commit is contained in:
Biscuit Boy 2018-04-19 22:47:03 +10:00
parent b401c951a7
commit 3310ee0fe6

View file

@ -226,29 +226,16 @@ void Core::Network::GameConnection::gm1Handler( const Packets::GamePacket& inPac
} }
case GmCommand::Invis: case GmCommand::Invis:
{ {
if( targetPlayer->getGmInvis() == false ) { player.setGmInvis( !player.getGmInvis() );
targetPlayer->setGmInvis( true ); player.sendNotice( "Invisibility flag for " + player.getName() +
auto inRange = targetPlayer->getInRangeActors(); " was toggled to " + std::to_string( !player.getGmInvis() ) );
for( auto actor : inRange )
{ for( auto actor : player.getInRangeActors() )
targetPlayer->despawn( actor->getAsPlayer() );
targetPlayer->spawn( actor->getAsPlayer() );
}
player.sendNotice( "Invisibility flag for " + targetPlayer->getName() + " was toggled to on" );
break;
}
else
{ {
targetPlayer->setGmInvis( false ); player.despawn( actor->getAsPlayer() );
auto inRange = targetPlayer->getInRangeActors(); player.spawn( actor->getAsPlayer() );
for( auto actor : inRange )
{
targetPlayer->despawn( actor->getAsPlayer() );
targetPlayer->spawn( actor->getAsPlayer() );
}
player.sendNotice( "Invisibility flag for " + targetPlayer->getName() + " was toggled to off" );
break;
} }
break;
} }
case GmCommand::Kill: case GmCommand::Kill:
{ {