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