Hacked in serverside effects

This commit is contained in:
2016-01-25 11:56:40 +01:00
parent 4245264029
commit b6fd18baed
5 changed files with 19 additions and 22 deletions
+9 -6
View File
@@ -25,14 +25,13 @@ bool WeaponSystem::OnPlayerSpawned(const Events::PlayerSpawned& e)
bool WeaponSystem::OnInputCommand(const Events::InputCommand& e)
{
// Only shoot if the player is alive
if (!m_LocalPlayer.Valid()) {
return false;
}
if (e.Command == "PrimaryFire" && e.Value > 0) {
Events::Shoot eShoot;
eShoot.Player = m_LocalPlayer;
if (e.PlayerID == -1) {
eShoot.Player = m_LocalPlayer;
} else {
eShoot.Player = e.Player;
}
m_EventBroker->Publish(eShoot);
}
@@ -41,6 +40,10 @@ bool WeaponSystem::OnInputCommand(const Events::InputCommand& e)
bool WeaponSystem::OnShoot(Events::Shoot& eShoot)
{
if (!eShoot.Player.Valid()) {
return false;
}
// TODO: Weapon firing effects here
auto rayRed = ResourceManager::Load<EntityFile>("Schema/Entities/RayRed.xml");