fix: player Position field showing [object Object]
Rust RCON returns Position as {x, y, z} object. Now formatted as
'x:123.4 y:56.7 z:89.0' instead of the default toString() garbage.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -62,6 +62,9 @@ function PlayerInfoPage(params, container) {
|
|||||||
var value = info[key];
|
var value = info[key];
|
||||||
if (key === 'Address') {
|
if (key === 'Address') {
|
||||||
value = maskIp(value);
|
value = maskIp(value);
|
||||||
|
} else if (typeof value === 'object' && value !== null) {
|
||||||
|
// e.g. Position: {x, y, z}
|
||||||
|
value = 'x:' + (value.x || 0).toFixed(1) + ' y:' + (value.y || 0).toFixed(1) + ' z:' + (value.z || 0).toFixed(1);
|
||||||
}
|
}
|
||||||
fieldsHtml += '<div class="col-sm-4"><p>' + key + ': <span class="badge">' + value + '</span></p></div>';
|
fieldsHtml += '<div class="col-sm-4"><p>' + key + ': <span class="badge">' + value + '</span></p></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user