Skip to content

Commit

Permalink
Moved MonsterHostility to MonsterEnums.h
Browse files Browse the repository at this point in the history
  • Loading branch information
captainurist committed Sep 19, 2023
1 parent e5c788b commit 2a00159
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 107 deletions.
14 changes: 7 additions & 7 deletions src/Engine/Graphics/Collisions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void ProcessActorCollisionsBLV(Actor &actor, bool isAboveGround, bool isFlying)
}

if (!isAboveGround && !isFlying) {
if (actor.monsterInfo.uHostilityType == MonsterInfo::HOSTILITY_FRIENDLY || isInCrowd)
if (actor.monsterInfo.uHostilityType == HOSTILITY_FRIENDLY || isInCrowd)
Actor::AI_StandOrBored(actor.id, Pid(OBJECT_Character, 0), 0, nullptr);

break; // Trying to walk into indoor sky, bad idea!
Expand Down Expand Up @@ -532,8 +532,8 @@ void ProcessActorCollisionsBLV(Actor &actor, bool isAboveGround, bool isFlying)

if (type == OBJECT_Actor) {
if (!pParty->bTurnBasedModeOn || (pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->turn_stage != TE_MOVEMENT)) {
bool isFriendly = actor.monsterInfo.uHostilityType == MonsterInfo::HOSTILITY_FRIENDLY;
bool otherFriendly = pActors[id].monsterInfo.uHostilityType == MonsterInfo::HOSTILITY_FRIENDLY;
bool isFriendly = actor.monsterInfo.uHostilityType == HOSTILITY_FRIENDLY;
bool otherFriendly = pActors[id].monsterInfo.uHostilityType == HOSTILITY_FRIENDLY;
if (isInCrowd) {
Actor::AI_StandOrBored(actor.id, Pid(OBJECT_Character, 0), 0, nullptr);
} else if (isFriendly && otherFriendly) {
Expand All @@ -545,7 +545,7 @@ void ProcessActorCollisionsBLV(Actor &actor, bool isAboveGround, bool isFlying)
}

if (type == OBJECT_Character) {
if (actor.GetActorsRelation(0) != MonsterInfo::HOSTILITY_FRIENDLY) {
if (actor.GetActorsRelation(0) != HOSTILITY_FRIENDLY) {
actor.speed.y = 0;
actor.speed.x = 0;

Expand Down Expand Up @@ -654,8 +654,8 @@ void ProcessActorCollisionsODM(Actor &actor, bool isFlying) {

if (type == OBJECT_Actor) {
if (!pParty->bTurnBasedModeOn || (pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->turn_stage != TE_MOVEMENT)) {
bool isFriendly = actor.monsterInfo.uHostilityType == MonsterInfo::HOSTILITY_FRIENDLY;
bool otherFriendly = pActors[id].monsterInfo.uHostilityType == MonsterInfo::HOSTILITY_FRIENDLY;
bool isFriendly = actor.monsterInfo.uHostilityType == HOSTILITY_FRIENDLY;
bool otherFriendly = pActors[id].monsterInfo.uHostilityType == HOSTILITY_FRIENDLY;
if (isInCrowd) {
Actor::AI_StandOrBored(actor.id, Pid(OBJECT_Character, 0), 0, nullptr);
} else if (isFriendly && otherFriendly) {
Expand All @@ -667,7 +667,7 @@ void ProcessActorCollisionsODM(Actor &actor, bool isFlying) {
}

if (type == OBJECT_Character) {
if (actor.GetActorsRelation(0) != MonsterInfo::HOSTILITY_FRIENDLY) {
if (actor.GetActorsRelation(0) != HOSTILITY_FRIENDLY) {
actor.speed.y = 0;
actor.speed.x = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Graphics/Indoor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ void PrepareToLoadBLV(bool bLoading) {

if (!v28) {
pActors[i].PrepareSprites(0);
pActors[i].monsterInfo.uHostilityType = MonsterInfo::HOSTILITY_FRIENDLY;
pActors[i].monsterInfo.uHostilityType = HOSTILITY_FRIENDLY;
if (pActors[i].monsterInfo.field_3E != 11 &&
pActors[i].monsterInfo.field_3E != 19 &&
(!pActors[i].currentHP || !pActors[i].monsterInfo.uHP)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Engine/Graphics/Outdoor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ bool OutdoorLocation::InitalizeActors(MapId a1) {
pActors[i].speed.z = 0;
pActors[i].UpdateAnimation();
pActors[i].monsterInfo.uHostilityType =
MonsterInfo::HOSTILITY_FRIENDLY;
HOSTILITY_FRIENDLY;
pActors[i].PrepareSprites(0);
} else {
pActors[i].aiState = AIState::Disabled;
Expand All @@ -1246,7 +1246,7 @@ bool OutdoorLocation::InitalizeActors(MapId a1) {
pActors[i].speed.z = 0;
pActors[i].UpdateAnimation();
pActors[i].monsterInfo.uHostilityType =
MonsterInfo::HOSTILITY_FRIENDLY;
HOSTILITY_FRIENDLY;
pActors[i].PrepareSprites(0);
} else {
pActors[i].aiState = AIState::Disabled;
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Graphics/Viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void ItemInteraction(unsigned int item_id) {
}

bool CanInteractWithActor(unsigned int id) {
return pActors[id].GetActorsRelation(0) == MonsterInfo::HOSTILITY_FRIENDLY && pActors[id].ActorFriend() && pActors[id].CanAct();
return pActors[id].GetActorsRelation(0) == HOSTILITY_FRIENDLY && pActors[id].ActorFriend() && pActors[id].CanAct();
}

void InteractWithActor(unsigned int id) {
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/Graphics/Vis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ bool Vis::isBillboardPartOfSelection(int billboardId, Vis_SelectionFilter *filte
return true;

auto relation = pActors[object_idx].GetActorsRelation(nullptr);
if (relation == MonsterInfo::HOSTILITY_FRIENDLY) return false;
if (relation == HOSTILITY_FRIENDLY) return false;
return true;
}

Expand Down
Loading

0 comments on commit 2a00159

Please sign in to comment.