修复坐标越界问题
This commit is contained in:
parent
e31af41d16
commit
52a360a193
@ -497,17 +497,17 @@ void Room::CreateLoot(int equip_id, Vector2D pos, int count, int equip_lv)
|
||||
entity->pos = pos;
|
||||
#if 1
|
||||
{
|
||||
if (entity->pos.x > MAP_WIDTH) {
|
||||
entity->pos.x = MAP_WIDTH;
|
||||
if (entity->pos.x >= MAP_WIDTH) {
|
||||
entity->pos.x = MAP_WIDTH - 1;
|
||||
}
|
||||
if (entity->pos.x <= 0.001f) {
|
||||
entity->pos.x = 0.0f;
|
||||
if (entity->pos.x < 1.0f) {
|
||||
entity->pos.x = 1.0f;
|
||||
}
|
||||
if (entity->pos.y > MAP_HEIGHT) {
|
||||
entity->pos.y = MAP_HEIGHT;
|
||||
if (entity->pos.y >= MAP_HEIGHT) {
|
||||
entity->pos.y = MAP_HEIGHT - 1;
|
||||
}
|
||||
if (entity->pos.y < 0.0001f) {
|
||||
entity->pos.y = 0.0f;
|
||||
if (entity->pos.y < 1.0f) {
|
||||
entity->pos.y = 1.0f;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user