make Species_info[] and Asteroid_info[] dynamic

This commit is contained in:
taylor committed 2006-08-27 18:12:42 +00:00
1 parent 3fcf521f96
commit 8a9d540c4c
19 files changed
+221 -155

No files matched your search

+2 -2
View File
@@ -1495,7 +1495,7 @@ LUA_VAR(Name, l_Species, "String", "Species name")
if(!lua_get_args(L, "o|s", l_Species.Get(&idx), &s))
return LUA_RETURN_NIL;
if(idx < 0 || idx > Num_species)
if(idx < 0 || idx >= (int)Species_info.size())
return LUA_RETURN_NIL;
if(LUA_SETTING_VAR && s != NULL) {
@@ -1816,7 +1816,7 @@ LUA_VAR(Species, l_Shipclass, "Species", "Ship class species")
if(idx < 0 || idx > Num_ship_classes)
return LUA_RETURN_NIL;
if(LUA_SETTING_VAR && sidx > -1 && sidx < Num_species) {
if(LUA_SETTING_VAR && sidx > -1 && sidx < (int)Species_info.size()) {
Ship_info[idx].species = sidx;
}