special[legacy]: make_town_hostile has only one meaning...
set_town_attitude: lo=-1,hi=-1 seems to mean all monsters at least in special...
This commit is contained in:
@@ -312,17 +312,24 @@ void set_town_attitude(short lo,short hi,eAttitude att) {
|
||||
univ.town.monst.hostile = true;
|
||||
long long num_monst = univ.town.monst.size();
|
||||
|
||||
// Nice smart indexing, like Python :D
|
||||
if(lo <= -num_monst)
|
||||
lo = 0;
|
||||
if(lo < 0)
|
||||
lo = num_monst + lo;
|
||||
if(hi <= -num_monst)
|
||||
hi = 0;
|
||||
if(hi < 0)
|
||||
hi = num_monst + hi;
|
||||
if(hi < lo)
|
||||
std::swap(lo, hi);
|
||||
if (lo==-1 && hi==-1) {
|
||||
// All monsters
|
||||
lo=0;
|
||||
hi=num_monst-1;
|
||||
}
|
||||
else {
|
||||
// Nice smart indexing, like Python :D
|
||||
if(lo <= -num_monst)
|
||||
lo = 0;
|
||||
if(lo < 0)
|
||||
lo = num_monst + lo;
|
||||
if(hi <= -num_monst)
|
||||
hi = 0;
|
||||
if(hi < 0)
|
||||
hi = num_monst + hi;
|
||||
if(hi < lo)
|
||||
std::swap(lo, hi);
|
||||
}
|
||||
|
||||
for(short i = lo; i <= hi; i++) {
|
||||
if(univ.town.monst[i].active > 0 && univ.town.monst[i].summon_time == 0){
|
||||
|
@@ -131,7 +131,7 @@ void cSpecial::import_legacy(legacy::special_node_type& old){
|
||||
// 154 was if text response
|
||||
case 155: type = eSpecType::IF_SDF_EQ; break;
|
||||
// 156-169 were undefined
|
||||
case 170: type = eSpecType::MAKE_TOWN_HOSTILE; break;
|
||||
case 170: type = eSpecType::MAKE_TOWN_HOSTILE; ex2a=1; break; // OSNOLA: make town always hostile
|
||||
// 171-173 were change/swap/transform terrain
|
||||
case 174: type = eSpecType::TOWN_MOVE_PARTY; break;
|
||||
case 175: type = eSpecType::TOWN_HIT_SPACE; break;
|
||||
|
Reference in New Issue
Block a user