MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / isBodyStateAllowed

Method isBodyStateAllowed

game/state/shared/agent.cpp:184–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184bool Agent::isBodyStateAllowed(BodyState bodyState) const
185{
186 static const std::list<EquipmentSlotType> armorslots = {
187 EquipmentSlotType::ArmorBody, EquipmentSlotType::ArmorHelmet,
188 EquipmentSlotType::ArmorLeftHand, EquipmentSlotType::ArmorLegs,
189 EquipmentSlotType::ArmorRightHand};
190
191 if (type->bodyType->allowed_body_states.find(bodyState) !=
192 type->bodyType->allowed_body_states.end())
193 {
194 return true;
195 }
196 if (bodyState == BodyState::Flying)
197 {
198 for (auto &t : armorslots)
199 {
200 auto e = getFirstItemInSlot(t);
201 if (e && e->type->provides_flight)
202 {
203 return true;
204 }
205 }
206 }
207 return false;
208}
209
210bool Agent::isMovementStateAllowed(MovementState movementState) const
211{

Callers 15

setReserveKneelModeMethod · 0.80
canFlyMethod · 0.80
canProneMethod · 0.80
canKneelMethod · 0.80
updateIdlingMethod · 0.80
tryToRiseUpMethod · 0.80
dropDownMethod · 0.80
setBodyStateMethod · 0.80
setMovementModeMethod · 0.80
BattleUnitTileHelperMethod · 0.80
getNextBodyStateMethod · 0.80
startMethod · 0.80

Calls 1

endMethod · 0.80

Tested by

no test coverage detected