Parcourir la source

fix crash with 8th creature and portal of s.

Laserlicht il y a 1 an
Parent
commit
758666d99d
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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();