mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-09 08:58:04 +00:00
branch back to working state
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user