this work. but engi turret is weird

This commit is contained in:
Aaron Kimbre
2023-12-29 01:07:58 -06:00
parent e5bea0a5ef
commit 05466f924d
7 changed files with 15 additions and 85 deletions

View File

@@ -725,7 +725,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
const auto isPlayer = m_Parent->IsPlayer();
GameMessages::SendDie(m_Parent, source, source, true, killType, deathType, 0, 0, 0, isPlayer, false, 1);
GameMessages::SendDie(m_Parent, source, source, true, killType, deathType, 0, 0, 0, isPlayer, false);
//NANI?!
if (!isPlayer) {

View File

@@ -41,7 +41,7 @@ QuickBuildComponent::QuickBuildComponent(Entity* parent, uint32_t id) : Activity
SetPostImaginationCost(rebCompData[0].post_imagination_cost);
SetTimeBeforeSmash(rebCompData[0].time_before_smash);
const auto compTime = m_Parent->GetVar<float>(u"compTime");
if (compTime > 0) SetCompleteTime(compTime);
if (m_Parent->HasVar(u"compTime") && compTime > 0) SetCompleteTime(compTime);
}
std::u16string checkPreconditions = m_Parent->GetVar<std::u16string>(u"CheckPrecondition");
@@ -118,8 +118,6 @@ void QuickBuildComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsIni
}
void QuickBuildComponent::Update(float deltaTime) {
m_Activator = GetActivator();
switch (m_State) {
case eQuickBuildState::OPEN: {
SpawnActivator();
@@ -141,9 +139,7 @@ void QuickBuildComponent::Update(float deltaTime) {
if (m_TimerIncomplete >= m_TimeBeforeSmash) {
ClearActivityPlayerData();
GameMessages::SendDie(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
ResetQuickBuild(false);
}
}
@@ -179,7 +175,6 @@ void QuickBuildComponent::Update(float deltaTime) {
if (!builder) {
ResetQuickBuild(false);
return;
}
@@ -206,6 +201,7 @@ void QuickBuildComponent::Update(float deltaTime) {
break;
}
}
Game::entityManager->SerializeEntity(builder);
if (m_Timer >= m_CompleteTime && m_DrainedImagination >= m_TakeImagination) {
CompleteQuickBuild(builder);
@@ -226,9 +222,7 @@ void QuickBuildComponent::Update(float deltaTime) {
if (m_TimerIncomplete >= m_TimeBeforeSmash) {
ClearActivityPlayerData();
GameMessages::SendDie(m_Parent, LWOOBJID_EMPTY, LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0.0f, 0.0f, 0.0f, false, true);
ResetQuickBuild(false);
}
}
@@ -273,11 +267,8 @@ void QuickBuildComponent::SpawnActivator() {
void QuickBuildComponent::DespawnActivator() {
if (m_Activator) {
Game::entityManager->DestructEntity(m_Activator);
m_Activator->ScheduleKillAfterUpdate();
m_Activator = nullptr;
m_ActivatorId = LWOOBJID_EMPTY;
}
}

View File

@@ -300,7 +300,7 @@ void RacingControlComponent::OnRequestDie(Entity* player) {
if (!racingPlayer.noSmashOnReload) {
racingPlayer.smashedTimes++;
GameMessages::SendDie(vehicle, vehicle->GetObjectID(), LWOOBJID_EMPTY, true,
eKillType::VIOLENT, u"", 0, 0, 90.0f, false, true, 0);
eKillType::VIOLENT, u"", 0, 0, 90.0f, false, true);
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
uint32_t respawnImagination = 0;
@@ -769,7 +769,7 @@ void RacingControlComponent::Update(float deltaTime) {
if (vehiclePosition.y < -500) {
GameMessages::SendDie(vehicle, m_Parent->GetObjectID(),
LWOOBJID_EMPTY, true, eKillType::VIOLENT, u"", 0, 0, 0,
true, false, 0);
true, false);
OnRequestDie(playerEntity);