Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/session.js
Show First 20 Lines • Show All 400 Lines • ▼ Show 20 Lines | for (let guid in g_PlayerAssignments) | ||||
playerData[playerID].guid = guid; | playerData[playerID].guid = guid; | ||||
playerData[playerID].name = g_PlayerAssignments[guid].name; | playerData[playerID].name = g_PlayerAssignments[guid].name; | ||||
} | } | ||||
g_Players = playerData; | g_Players = playerData; | ||||
} | } | ||||
/** | /** | ||||
* Returns the entity itself except when garrisoned where it returns its garrisonHolder | * Returns the entity itself except when garrisoned where it returns its garrisonHolder. | ||||
Stan: Could specify that it's a number too. | |||||
*/ | */ | ||||
function getEntityOrHolder(ent) | function getEntityOrHolder(ent) | ||||
{ | { | ||||
let entState = GetEntityState(ent); | let entState = GetEntityState(ent); | ||||
if (entState && !entState.position && entState.unitAI && entState.unitAI.orders.length && | if (entState && !entState.position && entState.garrisonable && entState.garrisonable.garrisonHolder != INVALID_ENTITY) | ||||
entState.unitAI.orders[0].type == "Garrison") | return getEntityOrHolder(entState.garrisonable.garrisonHolder); | ||||
return getEntityOrHolder(entState.unitAI.orders[0].data.target); | |||||
return ent; | return ent; | ||||
} | } | ||||
function initializeMusic() | function initializeMusic() | ||||
{ | { | ||||
initMusic(); | initMusic(); | ||||
if (g_ViewedPlayer != -1 && g_CivData[g_Players[g_ViewedPlayer].civ].Music) | if (g_ViewedPlayer != -1 && g_CivData[g_Players[g_ViewedPlayer].civ].Music) | ||||
▲ Show 20 Lines • Show All 381 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Could specify that it's a number too.