Fix bug where players aren't considered online character anymore

This commit is contained in:
Jean-Baptiste Emmanuel Zorg 2025-03-18 03:51:02 +01:00
parent e51138b4a2
commit 051bf3ba28
2 changed files with 7 additions and 4 deletions
BondageClub
Screens/Character/Appearance
Scripts

View file

@ -297,7 +297,7 @@ function CharacterAppearanceNaked(C) {
// For each item group (non default items only show at a 20% rate)
for (let A = C.Appearance.length - 1; A >= 0; A--)
if (C.Appearance[A].Asset.Group.AllowNone && (C.Appearance[A].Asset.Group.Category == "Appearance") && (!C.IsOnline() || !(C.OnlineSharedSettings.BlockBodyCosplay && (C.Appearance[A].Asset != null) && (C.Appearance[A].Asset.Group != null) && C.Appearance[A].Asset.Group.BodyCosplay)))
if (C.Appearance[A].Asset.Group.AllowNone && (C.Appearance[A].Asset.Group.Category == "Appearance") && (!(C.IsOnline() && C.IsPlayer()) || !(C.OnlineSharedSettings.BlockBodyCosplay && (C.Appearance[A].Asset != null) && (C.Appearance[A].Asset.Group != null) && C.Appearance[A].Asset.Group.BodyCosplay)))
C.Appearance.splice(A, 1);
// Loads the new character canvas

View file

@ -809,8 +809,10 @@ function CharacterBuildDialog(C, CSV, functionPrefix, reload=true) {
};
// Prefix with the current screen unless this is a Dialog function or an online character
if (D.Function && D.Function !== "")
D.Function = (D.Function.startsWith("Dialog") ? "" : C.IsOnline() ? "ChatRoom" : functionPrefix) + D.Function;
if (D.Function && D.Function !== "") {
// @ts-expect-error Not sure why the online || player check errors here
D.Function = (D.Function.startsWith("Dialog") ? "" : (C.IsOnline() || C.IsPlayer()) ? "ChatRoom" : functionPrefix) + D.Function;
}
C.Dialog.push(D);
}
@ -1797,7 +1799,8 @@ function CharacterSetFacialExpression(C, AssetGroup, Expression, Timer, Color, f
const isTransient = Timer != null || fromQueue;
CharacterRefresh(C, !inChatRoom && !isTransient, false);
if (inChatRoom && C.IsOnline()) {
// @ts-expect-error Not sure why the online || player check errors here
if (inChatRoom && (C.IsOnline() || C.IsPlayer())) {
if (isTransient || C.IsPlayer()) {
ChatRoomCharacterExpressionUpdate(C, AssetGroup);
} else {