1
This commit is contained in:
parent
25aecdf0e5
commit
b4fbb9d751
@ -72,7 +72,7 @@ void MapService::UnInit()
|
|||||||
bool MapService::CanAdd(const a8::Vec2& pos, int rad)
|
bool MapService::CanAdd(const a8::Vec2& pos, int rad)
|
||||||
{
|
{
|
||||||
//上
|
//上
|
||||||
if (pos.y + rad + 10 > map_height_) {
|
if (pos.y + rad + 10 > map_height_ * cell_width_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//下
|
//下
|
||||||
@ -84,7 +84,7 @@ bool MapService::CanAdd(const a8::Vec2& pos, int rad)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//右
|
//右
|
||||||
if (pos.x + rad + 10 > map_width_) {
|
if (pos.x + rad + 10 > map_width_ * cell_width_) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user