branch back to working state

This commit is contained in:
David Markowitz
2024-02-10 19:23:35 -08:00
parent 790505ba6f
commit 944d3e1bac
9 changed files with 36 additions and 35 deletions

View File

@@ -3,15 +3,15 @@
#include "GameMessages.h"
#include "MovingPlatformComponent.h"
void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
void PropertyPlatform::OnQuickBuildComplete(Entity* self, Entity* target) {
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS
, static_cast<eMovementPlatformState>(eMovementPlatformState::Waiting | eMovementPlatformState::ReachedDesiredWaypoint | eMovementPlatformState::ReachedFinalWaypoint),
true, 0, 0, 0);
}
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::COMPLETED) {
auto* rebuildComponent = self->GetComponent<QuickBuildComponent>();
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eQuickBuildState::COMPLETED) {
GameMessages::SendPlatformResync(self, UNASSIGNED_SYSTEM_ADDRESS, eMovementPlatformState::Travelling, true, 0,
1, 1);

View File

@@ -327,11 +327,13 @@ void SGCannon::DoSpawnTimerFunc(Entity* self, const std::string& name) {
// Save the enemy and tell it to start pathing
if (enemy != nullptr) {
const_cast<std::vector<LWOOBJID>&>(self->GetVar<std::vector<LWOOBJID>>(SpawnedObjects)).push_back(enemy->GetObjectID());
GameMessages::SendPlatformResync(enemy, UNASSIGNED_SYSTEM_ADDRESS);
GameMessages::SendPlatformResync(enemy, UNASSIGNED_SYSTEM_ADDRESS, eMovementPlatformState::Travelling);
}
}
}
#pragma warning("TODO: FIX THE ABOVE GM CALL")
void SGCannon::EndGameBufferTimerFunc(Entity* self) {
RecordPlayerScore(self);
StopGame(self, false);
@@ -381,9 +383,7 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
auto* enemy = Game::entityManager->CreateEntity(info, nullptr, self);
Game::entityManager->ConstructEntity(enemy);
auto* movementAI = new MovementAIComponent(enemy, {});
enemy->AddComponent(eReplicaComponentType::MOVEMENT_AI, movementAI);
auto* movementAI = enemy->AddComponent<MovementAIComponent, MovementAIInfo>({});
movementAI->SetMaxSpeed(toSpawn.initialSpeed);
movementAI->SetCurrentSpeed(toSpawn.initialSpeed);