Confusion between entity.Team and mobileEnemy.Team

Moderators will move topics here from Help & Support once an issue has been confirmed and enough information provided to reproduce.
Post Reply
User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Confusion between entity.Team and mobileEnemy.Team

Post by DunnyOfPenwick »

I operate under the assumption that mobileEnemy.Team is the 'default' team for an enemy, and entity.Team is the current (possibly temporary) team, so in the majority of instances entity.Team should be checked.

I've seen some code that confuses me:

EnemySenses.GetTarget() references both mobileEnemy.Team and entity.Team.

GameManager.AreEnemiesNearby() checks mobileEnemy.Team whereas GameManager.HowManyEnemiesOfType() checks entity.Team

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Confusion between entity.Team and mobileEnemy.Team

Post by Interkarma »

Could be down to different people implementing things at different times.

I'll move this into Issues so I review later.

Post Reply