添加地形处理
This commit is contained in:
parent
afdf2a2056
commit
615936eaa6
@ -1411,10 +1411,10 @@ void Creature::CheckSpecObject()
|
|||||||
room->map_service->GetSpecColliders(SPEC_MAP_OBJECT_FLAGS, room, GetPos().x, GetPos().y, colliders);
|
room->map_service->GetSpecColliders(SPEC_MAP_OBJECT_FLAGS, room, GetPos().x, GetPos().y, colliders);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
long long old_cell_flags = cell_flags_;
|
|
||||||
int water_w = 0;
|
int water_w = 0;
|
||||||
int water_h = 0;
|
int water_h = 0;
|
||||||
#endif
|
#endif
|
||||||
|
long long old_cell_flags = cell_flags_;
|
||||||
cell_flags_ = 0;
|
cell_flags_ = 0;
|
||||||
for (const ColliderComponent* collider : colliders) {
|
for (const ColliderComponent* collider : colliders) {
|
||||||
switch (collider->owner->GetEntityType()) {
|
switch (collider->owner->GetEntityType()) {
|
||||||
@ -1436,6 +1436,32 @@ void Creature::CheckSpecObject()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (old_cell_flags != cell_flags_) {
|
||||||
|
if (!a8::SameBitFlag(old_cell_flags, cell_flags_, kColliderTag_Grass)) {
|
||||||
|
if (a8::HasBitFlag(cell_flags_, kColliderTag_Grass)) {
|
||||||
|
TryAddBuff(this, kInGrassBuffId);
|
||||||
|
} else {
|
||||||
|
RemoveBuffById(kInGrassBuffId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!a8::SameBitFlag(old_cell_flags, cell_flags_, kColliderTag_Water)) {
|
||||||
|
if (a8::HasBitFlag(cell_flags_, kColliderTag_Water)) {
|
||||||
|
TryAddBuff(this, kInWaterBuffId);
|
||||||
|
} else {
|
||||||
|
RemoveBuffById(kInWaterBuffId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!a8::SameBitFlag(old_cell_flags, cell_flags_, kColliderTag_Ice)) {
|
||||||
|
if (a8::HasBitFlag(cell_flags_, kColliderTag_Ice)) {
|
||||||
|
TryAddBuff(this, kInIceBuffId);
|
||||||
|
} else {
|
||||||
|
RemoveBuffById(kInIceBuffId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (IsPlayer()) {
|
if (IsPlayer()) {
|
||||||
if (old_cell_flags != cell_flags_) {
|
if (old_cell_flags != cell_flags_) {
|
||||||
|
2
third_party/a8engine
vendored
2
third_party/a8engine
vendored
@ -1 +1 @@
|
|||||||
Subproject commit f32b842baf3c97def6871a831dd4509842d461ea
|
Subproject commit 41cb09fe83abc21db2e912117d11feceb4b00a55
|
Loading…
x
Reference in New Issue
Block a user