Fixez
This commit is contained in:
+1
-1
Submodule assets updated: c44c64df2b...de87617060
@@ -37,7 +37,7 @@ namespace GUI
|
||||
if (!health)
|
||||
return false;
|
||||
|
||||
SetColor(glm::vec4(1.f, 1.f, 1.f, 1 - (health->Amount / 100.f * 2)));
|
||||
SetColor(glm::vec4(1.f, 1.f, 1.f, 1 - (health->Amount / 100.f / 2.f)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ namespace GUI
|
||||
EventRelay<Frame, Events::Dead> m_EDead;
|
||||
bool OnDead(const Events::Dead &event)
|
||||
{
|
||||
auto playerCo = m_World->GetComponent<Components::Player>(event.Entity);
|
||||
if (!playerCo || m_PlayerID != playerCo->ID)
|
||||
return false;
|
||||
|
||||
m_VehicleSelection->Show();
|
||||
m_HealthOverlay->SetColor(glm::vec4(1, 1, 1, 0));
|
||||
return true;
|
||||
|
||||
@@ -920,6 +920,12 @@ bool Systems::PhysicsSystem::OnDead( const Events::Dead &e )
|
||||
m_World->RemoveComponent<Components::TankSteering>(e.Entity);
|
||||
}
|
||||
|
||||
auto listener = m_World->GetComponent<Components::Listener>(e.Entity);
|
||||
if (listener)
|
||||
{
|
||||
m_World->RemoveComponent<Components::Listener>(e.Entity);
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#include "Components/Trigger.h"
|
||||
#include "Components/Template.h"
|
||||
#include "Components/Camera.h"
|
||||
#include "Components/Listener.h"
|
||||
#include "Events/EnterTrigger.h"
|
||||
#include "Events/JeepSteer.h"
|
||||
#include "Events/Dead.h"
|
||||
|
||||
@@ -61,7 +61,7 @@ void Systems::TankSteeringSystem::UpdateEntity(double dt, EntityID entity, Entit
|
||||
if(vehicleComp)
|
||||
{
|
||||
auto transform = m_World->GetComponent<Components::Transform>(entity);
|
||||
if(transform->Position.y < 0)
|
||||
if (transform->Position.y < -15 && transform->Position.y > -100)
|
||||
{
|
||||
Events::Dead e;
|
||||
e.Entity = entity;
|
||||
@@ -596,8 +596,8 @@ EntityID Systems::TankSteeringSystem::CreateTank(int playerID)
|
||||
auto shape = m_World->CreateEntity(shot);
|
||||
auto transform = m_World->AddComponent<Components::Transform>(shape);
|
||||
auto boxShape = m_World->AddComponent<Components::BoxShape>(shape);
|
||||
boxShape->Width = 0.5f;
|
||||
boxShape->Height = 0.5f;
|
||||
boxShape->Width = 0.1f;
|
||||
boxShape->Height = 0.1f;
|
||||
boxShape->Depth = 0.5f;
|
||||
m_World->CommitEntity(shape);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user