benilla-re systems structs docs

CGUnit_C::UnitReaction_Unit

function · objectlayer · primitive

Address
0x606530 · 259 bytes, up to 0x606632
Signature
uint32_t __fastcall (uint32_t factionTemplate, CGUnit_C *other)
Meaning
Returns a faction template's reaction toward a unit: contested guard, forced, reputation, then the templates
Confidence
verified, proof one
Name from
the community database (idb)
Finding
objectlayer/reaction#faction-toward-a-unit

Finding: Faction toward a unit in objectlayer: reaction

0x606530(template, B) is a faction template's reaction toward unit B. A missing row on either side is 3. When B is controlled by the active player, three rules come first: a contested guard template (flag 0x1000) is hostile, 1, to a player flagged contested, bit 8 of PLAYER_FLAGS; a forced reaction for the template's faction is returned; a faction with a reputation slot returns the player's standing rank. Otherwise the templates are compared. 0x6061e0 calls it with A's template and caps the result at 6; when A is persuaded by B (field 18 holds B's GUID) or B has bit 14 of its unit flags, a rank of 2 to 4 rises by one, for a reputation faction only.

The derivation is in the doc.

Callers 2

Callees 6

Calls and jumps by a bare address, from tables/calls.tsv.