1
This commit is contained in:
parent
9ec0b6fd47
commit
1629441404
@ -471,7 +471,7 @@ void Buff::SetCaster(Creature* caster)
|
||||
|
||||
void Buff::ProcPullToWalkable()
|
||||
{
|
||||
if (owner->CollisonDetection()) {
|
||||
if (!owner->CollisonDetection()) {
|
||||
return;
|
||||
}
|
||||
a8::Vec2 move_dir = owner->GetMoveDir();
|
||||
@ -481,7 +481,7 @@ void Buff::ProcPullToWalkable()
|
||||
a8::Vec2 old_pos = owner->GetPos();
|
||||
for (int i = 1; i < 2000; i += 5) {
|
||||
owner->SetPos(old_pos + move_dir * i);
|
||||
if (owner->CollisonDetection()) {
|
||||
if (!owner->CollisonDetection()) {
|
||||
owner->room->grid_service->MoveCreature(owner);
|
||||
return;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "entity.h"
|
||||
#include "roomobstacle.h"
|
||||
#include "room.h"
|
||||
#include "metamgr.h"
|
||||
|
||||
MapService::MapService()
|
||||
{
|
||||
@ -306,8 +307,10 @@ bool MapService::CollisionDetection(Room* room,
|
||||
case ET_Obstacle:
|
||||
{
|
||||
Obstacle* obstacle = (Obstacle*)collider->owner;
|
||||
if (!obstacle->IsDead(room) && collider->IntersectEx(pos, a_collider)) {
|
||||
return true;
|
||||
if (obstacle->meta->i->collision_hit() != kCollisionHitPass) {
|
||||
if (!obstacle->IsDead(room) && collider->IntersectEx(pos, a_collider)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user