MCPcopy Create free account
hub / github.com/EasyRPG/Player / WouldCollide

Function WouldCollide

src/game_map.cpp:715–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713}
714
715static bool WouldCollide(const Game_Character& self, const Game_Character& other, bool self_conflict) {
716 if (self.GetThrough() || other.GetThrough()) {
717 return false;
718 }
719
720 if (self.IsFlying() || other.IsFlying()) {
721 return false;
722 }
723
724 if (!self.IsActive() || !other.IsActive()) {
725 return false;
726 }
727
728 if (self.GetType() == Game_Character::Event
729 && other.GetType() == Game_Character::Event
730 && (self.IsOverlapForbidden() || other.IsOverlapForbidden())) {
731 return true;
732 }
733
734 if (other.GetLayer() == lcf::rpg::EventPage::Layers_same && self_conflict) {
735 return true;
736 }
737
738 if (self.GetLayer() == other.GetLayer()) {
739 return true;
740 }
741
742 return false;
743}
744
745template <typename T>
746static void MakeWayUpdate(T& other) {

Callers 2

CheckWayTestCollideEventFunction · 0.85
MakeWayCollideEventFunction · 0.85

Calls 6

GetThroughMethod · 0.80
IsOverlapForbiddenMethod · 0.80
GetLayerMethod · 0.80
IsFlyingMethod · 0.45
IsActiveMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected