This commit is contained in:
aozhiwei 2021-07-02 17:37:46 +08:00
parent 707729778e
commit 861848b946
2 changed files with 15 additions and 0 deletions

View File

@ -236,6 +236,9 @@ void Bullet::ProcSmokeBomb()
bool Bullet::IsBomb()
{
if (!meta) {
return false;
}
return
meta->i->_inventory_slot() == IS_RPG ||
meta->i->_inventory_slot() == IS_FRAG ||

View File

@ -84,6 +84,18 @@ void GridService::GetAllCellsByXy(Room* room, int x, int y, std::set<GridCell*>&
bool GridService::CanAdd(float x, float y)
{
if (x < 0) {
return false;
}
if (y < 0) {
return false;
}
if (x > map_width_) {
return false;
}
if (y > map_height_) {
return false;
}
int new_x = (int)x + cell_width_;
int new_y = (int)x + cell_width_;
return !BroderOverFlow(new_x, new_y);