1
This commit is contained in:
parent
f80f1451bf
commit
d3fa248015
@ -61,6 +61,9 @@ Room* VirtualBullet::GetRoom()
|
||||
|
||||
void VirtualBullet::Update(int delta_time)
|
||||
{
|
||||
if (later_removed_) {
|
||||
return;
|
||||
}
|
||||
if (sender.Get()) {
|
||||
float move_length = gun_meta->i->bullet_speed() / (float)SERVER_FRAME_RATE;
|
||||
do {
|
||||
@ -84,6 +87,8 @@ void VirtualBullet::Update(int delta_time)
|
||||
Check(distance);
|
||||
}
|
||||
} while(!later_removed_ && move_length >= 0.0001f);
|
||||
} else {
|
||||
ForceRemove();
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,7 +266,9 @@ void VirtualBullet::Check(float distance)
|
||||
|
||||
void VirtualBullet::ForceRemove()
|
||||
{
|
||||
|
||||
if (!later_removed_) {
|
||||
later_removed_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
void VirtualBullet::OnHit(std::set<Entity*>& objects)
|
||||
@ -274,11 +281,6 @@ void VirtualBullet::Init()
|
||||
room->grid_service->GetAllCellsByXy(room, GetPos().x, GetPos().y, grid_list_);
|
||||
}
|
||||
|
||||
bool VirtualBullet::TestCollision(Room* room, Entity* b)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VirtualBullet::TestCollision(Room* room, ColliderComponent* b)
|
||||
{
|
||||
return false;
|
||||
|
@ -49,7 +49,6 @@ class VirtualBullet : public IBullet, public ITask
|
||||
void ForceRemove();
|
||||
void OnHit(std::set<Entity*>& objects);
|
||||
std::set<GridCell*>& GetGridList() { return grid_list_; };
|
||||
bool TestCollision(Room* room, Entity* b);
|
||||
bool TestCollision(Room* room, ColliderComponent* b);
|
||||
void OnStrengthen(Obstacle* ob);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user