mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-17 03:37:08 -06:00
Compare commits
2 Commits
AddEntityS
...
jetpack-us
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b0f374ab4 | |||
| bb20aa7f86 |
@@ -1,6 +1,7 @@
|
|||||||
#include "JetPackBehavior.h"
|
#include "JetPackBehavior.h"
|
||||||
|
|
||||||
#include "BehaviorBranchContext.h"
|
#include "BehaviorBranchContext.h"
|
||||||
|
#include "ControllablePhysicsComponent.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
|
|
||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
@@ -12,11 +13,11 @@ void JetPackBehavior::Handle(BehaviorContext* context, RakNet::BitStream* bit_st
|
|||||||
|
|
||||||
if (entity->IsPlayer()) {
|
if (entity->IsPlayer()) {
|
||||||
auto* character = entity->GetCharacter();
|
auto* character = entity->GetCharacter();
|
||||||
|
if (character) character->SetIsFlying(true);
|
||||||
if (character) {
|
|
||||||
character->SetIsFlying(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
|
if (controllablePhysicsComponent) controllablePhysicsComponent->SetJetpackFlying(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JetPackBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch) {
|
void JetPackBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext branch) {
|
||||||
@@ -26,11 +27,11 @@ void JetPackBehavior::UnCast(BehaviorContext* context, BehaviorBranchContext bra
|
|||||||
|
|
||||||
if (entity->IsPlayer()) {
|
if (entity->IsPlayer()) {
|
||||||
auto* character = entity->GetCharacter();
|
auto* character = entity->GetCharacter();
|
||||||
|
if (character) character->SetIsFlying(false);
|
||||||
if (character) {
|
|
||||||
character->SetIsFlying(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
||||||
|
if (controllablePhysicsComponent) controllablePhysicsComponent->SetJetpackFlying(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JetPackBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bit_stream, const BehaviorBranchContext branch) {
|
void JetPackBehavior::Calculate(BehaviorContext* context, RakNet::BitStream* bit_stream, const BehaviorBranchContext branch) {
|
||||||
|
|||||||
@@ -127,12 +127,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void SetDirtyAngularVelocity(bool val);
|
void SetDirtyAngularVelocity(bool val);
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets whether or not the entity is currently wearing a jetpack
|
|
||||||
* @param val whether or not the entity is currently wearing a jetpack
|
|
||||||
*/
|
|
||||||
void SetInJetpackMode(bool val) { m_InJetpackMode = val; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not the entity is currently wearing a jetpack
|
* Returns whether or not the entity is currently wearing a jetpack
|
||||||
* @return whether or not the entity is currently wearing a jetpack
|
* @return whether or not the entity is currently wearing a jetpack
|
||||||
@@ -143,7 +137,7 @@ public:
|
|||||||
* Sets whether or not the entity is currently flying a jetpack
|
* Sets whether or not the entity is currently flying a jetpack
|
||||||
* @param val whether or not the entity is currently flying a jetpack
|
* @param val whether or not the entity is currently flying a jetpack
|
||||||
*/
|
*/
|
||||||
void SetJetpackFlying(bool val) { m_JetpackFlying = val; }
|
void SetJetpackFlying(bool val) { m_JetpackFlying = val; m_DirtyEquippedItemInfo = true;}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not an entity is currently flying a jetpack
|
* Returns whether or not an entity is currently flying a jetpack
|
||||||
|
|||||||
Reference in New Issue
Block a user