Update BaseEnemyMech script to change the default faction

As part of the base enemy mech script its faction should be updated to 4
to make sure it's seen as an enemy by the client. The AgDarklingMech script
has been deleted as its functionality was essentially that of BaseEnemyMech
and thus no longer necessary.
This commit is contained in:
Mick Vermeulen
2021-12-08 20:00:00 +01:00
parent a923a2baa7
commit f22bf24663
7 changed files with 12 additions and 21 deletions

View File

@@ -7,6 +7,14 @@
#include "EntityManager.h"
#include "dpWorld.h"
#include "GeneralUtils.h"
#include "DestroyableComponent.h"
void BaseEnemyMech::OnStartup(Entity* self) {
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
if (destroyableComponent != nullptr) {
destroyableComponent->SetFaction(4);
}
}
void BaseEnemyMech::OnDie(Entity* self, Entity* killer) {
ControllablePhysicsComponent* controlPhys = static_cast<ControllablePhysicsComponent*>(self->GetComponent(COMPONENT_TYPE_CONTROLLABLE_PHYSICS));