Browse Source

Empty trader lists are no longer reported

feature_improvement
Anton Tarasenko 2 years ago
parent
commit
bcbff9c861
  1. 21
      sources/Commands/ACommandTrader_Announcer.uc

21
sources/Commands/ACommandTrader_Announcer.uc

@ -181,6 +181,9 @@ public final function AnnounceTradersOpened(ListBuilder traderList)
tradersOpened.toSelfPublic = _.text.MakeTemplate_S( tradersOpened.toSelfPublic = _.text.MakeTemplate_S(
"%%instigator%% {$TextPositive opened} following traders: %1"); "%%instigator%% {$TextPositive opened} following traders: %1");
} }
if (traderList.IsEmpty()) {
return;
}
traderListAsText = traderList.GetMutable(); traderListAsText = traderList.GetMutable();
templates = MakeArray(tradersOpened); templates = MakeArray(tradersOpened);
for (i = 0; i < templates.length; i += 1) { for (i = 0; i < templates.length; i += 1) {
@ -204,6 +207,9 @@ public final function AnnounceTradersClosed(ListBuilder traderList)
tradersClosed.toSelfPublic = _.text.MakeTemplate_S( tradersClosed.toSelfPublic = _.text.MakeTemplate_S(
"%%instigator%% {$TextNegative closed} following traders: %1"); "%%instigator%% {$TextNegative closed} following traders: %1");
} }
if (traderList.IsEmpty()) {
return;
}
traderListAsText = traderList.GetMutable(); traderListAsText = traderList.GetMutable();
templates = MakeArray(tradersClosed); templates = MakeArray(tradersClosed);
for (i = 0; i < templates.length; i += 1) { for (i = 0; i < templates.length; i += 1) {
@ -290,6 +296,9 @@ public final function AnnounceBootedPlayers(ListBuilder traderList)
"%%instigator%% {$TextNegative booted} players from following" "%%instigator%% {$TextNegative booted} players from following"
@ "traders: %1"); @ "traders: %1");
} }
if (traderList.IsEmpty()) {
return;
}
traderListAsText = traderList.GetMutable(); traderListAsText = traderList.GetMutable();
templates = MakeArray(bootedPlayers); templates = MakeArray(bootedPlayers);
for (i = 0; i < templates.length; i += 1) { for (i = 0; i < templates.length; i += 1) {
@ -313,6 +322,9 @@ public final function AnnounceEnabledTraders(ListBuilder traderList)
enabledTraders.toSelfPublic = _.text.MakeTemplate_S( enabledTraders.toSelfPublic = _.text.MakeTemplate_S(
"%%instigator%% {$TextPositive enabled} following traders: %1"); "%%instigator%% {$TextPositive enabled} following traders: %1");
} }
if (traderList.IsEmpty()) {
return;
}
traderListAsText = traderList.GetMutable(); traderListAsText = traderList.GetMutable();
templates = MakeArray(enabledTraders); templates = MakeArray(enabledTraders);
for (i = 0; i < templates.length; i += 1) { for (i = 0; i < templates.length; i += 1) {
@ -336,6 +348,9 @@ public final function AnnounceDisabledTraders(ListBuilder traderList)
disabledTraders.toSelfPublic = _.text.MakeTemplate_S( disabledTraders.toSelfPublic = _.text.MakeTemplate_S(
"%%instigator%% {$TextNegative disabled} following traders: %1"); "%%instigator%% {$TextNegative disabled} following traders: %1");
} }
if (traderList.IsEmpty()) {
return;
}
traderListAsText = traderList.GetMutable(); traderListAsText = traderList.GetMutable();
templates = MakeArray(disabledTraders); templates = MakeArray(disabledTraders);
for (i = 0; i < templates.length; i += 1) { for (i = 0; i < templates.length; i += 1) {
@ -360,6 +375,9 @@ public final function AnnounceAutoOpenTraders(ListBuilder traderList)
"%%instigator%% made following traders {$TextPositive automatically" "%%instigator%% made following traders {$TextPositive automatically"
@ "openable}: %1"); @ "openable}: %1");
} }
if (traderList.IsEmpty()) {
return;
}
traderListAsText = traderList.GetMutable(); traderListAsText = traderList.GetMutable();
templates = MakeArray(autoOpenTraders); templates = MakeArray(autoOpenTraders);
for (i = 0; i < templates.length; i += 1) { for (i = 0; i < templates.length; i += 1) {
@ -385,6 +403,9 @@ public final function AnnounceDoNotAutoOpenTraders(ListBuilder traderList)
"%%instigator%% made following traders {$TextNegative no longer}" "%%instigator%% made following traders {$TextNegative no longer}"
@ "automatically openable: %1"); @ "automatically openable: %1");
} }
if (traderList.IsEmpty()) {
return;
}
traderListAsText = traderList.GetMutable(); traderListAsText = traderList.GetMutable();
templates = MakeArray(doNotAutoOpenTraders); templates = MakeArray(doNotAutoOpenTraders);
for (i = 0; i < templates.length; i += 1) { for (i = 0; i < templates.length; i += 1) {

Loading…
Cancel
Save