1
This commit is contained in:
parent
0efe12e24f
commit
3683a0a00d
@ -1413,56 +1413,20 @@ void Creature::DecInventory(int slot_id, int num)
|
|||||||
|
|
||||||
void Creature::CheckSpecObject(int new_poly_flags)
|
void Creature::CheckSpecObject(int new_poly_flags)
|
||||||
{
|
{
|
||||||
#if 0
|
if (poly_ext_flags_ != new_poly_flags) {
|
||||||
int old_poly_ext_flags = poly_ext_flags_;
|
for (int i = 0; i < 16; ++i) {
|
||||||
poly_ext_flags_ = 0;
|
if (!a8::SameBitFlag(poly_ext_flags_, new_poly_flags, i)) {
|
||||||
{
|
if ((1 << i) == SAMPLE_POLYFLAGS_SWIM) {
|
||||||
int poly_idx = 0;
|
if (a8::HasBitFlag(poly_ext_flags_, i)) {
|
||||||
dtPoly* poly = room->map_instance->GetPoly(GetPos().ToGlmVec3(), poly_idx);
|
TryAddBuff(this, kInWater1BuffId);
|
||||||
if (poly) {
|
} else {
|
||||||
poly_ext_flags_ = room->GetPolyExtFlag(poly_idx);
|
RemoveBuffByEffectId(kBET_InWater);
|
||||||
}
|
|
||||||
}
|
|
||||||
if (old_poly_ext_flags != poly_ext_flags_) {
|
|
||||||
for (int i = 0; i < sizeof(poly_ext_flags_) * 8; ++i) {
|
|
||||||
if (!a8::SameBitFlag(old_poly_ext_flags, poly_ext_flags_, i)) {
|
|
||||||
switch (i) {
|
|
||||||
case kWater1ExtFlag:
|
|
||||||
{
|
|
||||||
if (a8::HasBitFlag(poly_ext_flags_, i)) {
|
|
||||||
TryAddBuff(this, kInWater1BuffId);
|
|
||||||
} else {
|
|
||||||
RemoveBuffByEffectId(kBET_InWater);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case kWater2ExtFlag:
|
|
||||||
{
|
|
||||||
if (a8::HasBitFlag(poly_ext_flags_, i)) {
|
|
||||||
TryAddBuff(this, kInWater2BuffId);
|
|
||||||
} else {
|
|
||||||
RemoveBuffByEffectId(kBET_InWater);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case kWater3ExtFlag:
|
|
||||||
{
|
|
||||||
if (a8::HasBitFlag(poly_ext_flags_, i)) {
|
|
||||||
TryAddBuff(this, kInWater3BuffId);
|
|
||||||
} else {
|
|
||||||
RemoveBuffByEffectId(kBET_InWater);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
poly_ext_flags_ = new_poly_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::SummonObstacle(Buff* buff, int id, const Position& target_pos)
|
void Creature::SummonObstacle(Buff* buff, int id, const Position& target_pos)
|
||||||
|
@ -377,11 +377,7 @@ bool MapInstance::Raycast(const glm::vec3& start, const glm::vec3& end,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (npolys <= 0) {
|
if (npolys <= 0) {
|
||||||
#ifdef DEBUG
|
|
||||||
abort();
|
|
||||||
#else
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t > 1) {
|
if (t > 1) {
|
||||||
@ -634,11 +630,7 @@ bool MapInstance::RaycastEx(const glm::vec3& start, const glm::vec3& end,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (npolys <= 0) {
|
if (npolys <= 0) {
|
||||||
#ifdef DEBUG
|
|
||||||
abort();
|
|
||||||
#else
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t > 1) {
|
if (t > 1) {
|
||||||
|
@ -83,7 +83,8 @@ void Movement::CalcTargetPos(float distance)
|
|||||||
glm::vec3 hit_point;
|
glm::vec3 hit_point;
|
||||||
owner_->room->map_instance->Scale(start);
|
owner_->room->map_instance->Scale(start);
|
||||||
owner_->room->map_instance->Scale(end);
|
owner_->room->map_instance->Scale(end);
|
||||||
bool ret = owner_->room->map_instance->Raycast(start, end, hit_point, hit_result);
|
bool ret = owner_->room->map_instance->RaycastEx(start, end, hit_point, hit_result,
|
||||||
|
point.same_polys_flags, point.spec_polys);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
owner_->room->map_instance->UnScale(hit_point);
|
owner_->room->map_instance->UnScale(hit_point);
|
||||||
point.tar_pos.FromGlmVec3(hit_point);
|
point.tar_pos.FromGlmVec3(hit_point);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user