Fixed bug counting unit near itself
This commit is contained in:
parent
f72a9b2fe0
commit
4b62e6a428
1 changed files with 12 additions and 0 deletions
|
@ -415,6 +415,12 @@ local SCM CclIfNearUnit(SCM player,SCM operation,SCM quantity,SCM unit,
|
|||
}
|
||||
}
|
||||
}
|
||||
// Check if we counted the unit near itself
|
||||
if( unittype==ANY_UNIT
|
||||
|| (unittype==ALL_FOODUNITS && ut2->Building)
|
||||
|| (unittype==ALL_BUILDINGS && ut2->Building) ) {
|
||||
--s;
|
||||
}
|
||||
if( compare(s,q) ) {
|
||||
return SCM_BOOL_T;
|
||||
}
|
||||
|
@ -505,6 +511,12 @@ local SCM CclIfRescuedNearUnit(SCM player,SCM operation,SCM quantity,SCM unit,
|
|||
}
|
||||
}
|
||||
}
|
||||
// Check if we counted the unit near itself
|
||||
if( unittype==ANY_UNIT
|
||||
|| (unittype==ALL_FOODUNITS && ut2->Building)
|
||||
|| (unittype==ALL_BUILDINGS && ut2->Building) ) {
|
||||
--s;
|
||||
}
|
||||
if( compare(s,q) ) {
|
||||
return SCM_BOOL_T;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue