Skip to content
Permalink
Browse files

`GetUnit{Armored,IsActive}`: allow enemies in los (#456)

* `GetUnit{Armored,IsActive}`: allow enemies in los

* add. previous and PR #371
  • Loading branch information...
sprunk authored and ashdnazg committed May 14, 2019
1 parent 1bbd8cd commit 26b617dc94ad236b5a2c584653aa7cc538e3095b
Showing with 4 additions and 2 deletions.
  1. +2 −0 doc/changelog.txt
  2. +2 −2 rts/Lua/LuaSyncedRead.cpp
@@ -102,6 +102,8 @@ Lua:
! Spring.GetTeamInfo: switched the last two return values around (incomeMultiplier is now 7th, customKeys is now 8th)
- Added a second boolean parameter to Spring.Get{Player,Team}Info, if it is false the function will not return
the (now) last return value, the customKeys table (allocation optimisation)
! Spring.GetUnit{Armored,IsActive} now works on enemies in LoS
! Spring.GetUnitMass no longer works on enemies outside of LoS

AI:
- reveal unit's captureProgress, buildProgress and paralyzeDamage params through
@@ -2771,7 +2771,7 @@ int LuaSyncedRead::GetUnitStates(lua_State* L)

int LuaSyncedRead::GetUnitArmored(lua_State* L)
{
const CUnit* unit = ParseAllyUnit(L, __func__, 1);
const CUnit* unit = ParseInLosUnit(L, __func__, 1);
if (unit == nullptr)
return 0;

@@ -2783,7 +2783,7 @@ int LuaSyncedRead::GetUnitArmored(lua_State* L)

int LuaSyncedRead::GetUnitIsActive(lua_State* L)
{
const CUnit* unit = ParseAllyUnit(L, __func__, 1);
const CUnit* unit = ParseInLosUnit(L, __func__, 1);
if (unit == nullptr)
return 0;

0 comments on commit 26b617d

Please sign in to comment.
You can’t perform that action at this time.