Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/session/session.js
Show First 20 Lines • Show All 403 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 | * @param {number} ent - The entity to get its ID for. | ||||
* @return {number} - The entity ID of the entity or of its garrisonHolder. | |||||
*/ | */ | ||||
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.holder != INVALID_ENTITY) | ||||
entState.unitAI.orders[0].type == "Garrison") | return getEntityOrHolder(entState.garrisonable.holder); | ||||
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 388 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator