Selaa lähdekoodia

* small fixes for creature banks info

mateuszb 16 vuotta sitten
vanhempi
sitoutus
320e3b9cde
2 muutettua tiedostoa jossa 14 lisäystä ja 2 poistoa
  1. 4 1
      config/crerefnam.txt
  2. 10 1
      hch/CObjectHandler.cpp

+ 4 - 1
config/crerefnam.txt

@@ -73,8 +73,10 @@
 71	InfernalTroglodyte
 72	Harpy
 73	HarpyHag
+73	M73
 74	Beholder
 75	EvilEye
+75	M75
 76	Medusa
 76	Medusae
 77	MedusaQueen
@@ -105,7 +107,8 @@
 102	CopperGorgon
 103	BronzeGorgon
 104	DragonFly
-104 SerpentFly
+104	SerpentFly
+104	Dragonflies
 105	FireDragonFly
 106	Basilisk
 107	GreaterBasilisk

+ 10 - 1
hch/CObjectHandler.cpp

@@ -22,6 +22,7 @@
 #include "../StartInfo.h"
 #include "../lib/map.h"
 #include <sstream>
+#include <SDL_stdinc.h>
 using namespace boost::assign;
 
 /*
@@ -177,9 +178,17 @@ void CObjectHandler::loadObjects()
 
 			istr >> bc.combatValue;
 			bc.resources.resize(RESOURCE_QUANTITY);
+			
+			//a dirty trick to make it work if there is no 0 for 0 quantity (like in grotto - last entry)
+			char buft[52];
+			istr.getline(buft, 50, '\t');
 			for(int h=0; h<7; ++h)
 			{
-				istr >> bc.resources[h];
+				istr.getline(buft, 50, '\t');
+				if(buft[0] == '\0')
+					bc.resources[h] = 0;
+				else
+					bc.resources[h] = SDL_atoi(buft);
 			}
 			readCreatures(istr, bc, false);