API:GetAndClearWarbandMemberDirtyFlag
From RoR Wiki
UI Lua API · Group functions
Version: WAR 1.4.8
Returns whether a warband member's status has changed since the last call, and resets that flag.
changed = GetAndClearWarbandMemberDirtyFlag(partyIndex, memberIndex)
Arguments
- partyIndex
number– Warband party, 1 to 4. Only the low 8 bits are used.- memberIndex
number– Member within that party, starting at 1. Only the low 8 bits are used.
Returns
- changed
boolean– The member's change flag before it was cleared.falseifmemberIndexis past the end of the party. Nothing ifpartyIndexis out of range or there is no player object.
Details
- The flag is cleared on every call that finds the member, so only the first caller after a change sees
true. - The stock UI uses the flag to decide when to re-read the member's values with GetWarbandMemberStatus.
- The function needs at least two arguments and only reads the last two.
Errors
None besides the generic Invalid Parameters message when an argument is not a number.
Example
From default/easystem_utils/source/partyutils.lua:
if( GetAndClearWarbandMemberDirtyFlag( partyIndex, memberIndex ) )
then
local memberData = GetWarbandMemberStatus( partyIndex, memberIndex )
...
end
