summaryrefslogtreecommitdiffstats
path: root/src/game-server/spawnareacomponent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game-server/spawnareacomponent.cpp')
-rw-r--r--src/game-server/spawnareacomponent.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game-server/spawnareacomponent.cpp b/src/game-server/spawnareacomponent.cpp
index 54cb017..33bd5ac 100644
--- a/src/game-server/spawnareacomponent.cpp
+++ b/src/game-server/spawnareacomponent.cpp
@@ -58,7 +58,6 @@ void SpawnAreaComponent::update(Entity &entity)
}
// Find a free spawn location. Give up after 10 tries
- int triesLeft = 10;
Point position;
const int x = mZone.x;
const int y = mZone.y;
@@ -81,6 +80,7 @@ void SpawnAreaComponent::update(Entity &entity)
if (being)
{
+ int triesLeft = 10;
do
{
position = Point(x + rand() % width, y + rand() % height);