Explorar o código

fix crash with 8th creature and portal of s.

Laserlicht hai 1 ano
pai
achega
758666d99d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      client/windows/CKingdomInterface.cpp

+ 1 - 1
client/windows/CKingdomInterface.cpp

@@ -866,7 +866,7 @@ void CTownItem::update()
 
 	heroes->update();
 
-	for (size_t i=0; i<town->creatures.size(); i++)
+	for (size_t i=0; i<std::min(static_cast<int>(town->creatures.size()), GameConstants::CREATURES_PER_TOWN); i++)
 	{
 		growth[i]->update();
 		available[i]->update();