summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-03-23 20:40:35 +0000
committerJesusalva Jesusalva <jesusalva@tmw2.org>2025-03-23 20:40:35 +0000
commit16bd3c94fcea9a8c5a2cab817c35cc34ac5d8792 (patch)
tree6c78d8d4b4b93c0613bde68415a2f11023c0fad7
parentfbbde8318d070ce77155f66309927576d3c7378f (diff)
downloadserverdata-16bd3c94fcea9a8c5a2cab817c35cc34ac5d8792.tar.gz
serverdata-16bd3c94fcea9a8c5a2cab817c35cc34ac5d8792.tar.bz2
serverdata-16bd3c94fcea9a8c5a2cab817c35cc34ac5d8792.tar.xz
serverdata-16bd3c94fcea9a8c5a2cab817c35cc34ac5d8792.zip
Nice scope block you got there %%I
I remember another smaller one somewhere, wonder if I can make a nice grep oneliner to find them all... * 'kay, how did that creep in * addendum - found by half-working script. optimised delitems too * Nice scope block you got there %%I **** ml/serverdata!189 Approved-by: Jesusalva Jesusalva <jesusalva@tmw2.org>
-rw-r--r--npc/craft/alchemy.txt7
-rw-r--r--npc/craft/cooking.txt7
-rw-r--r--npc/craft/smith.txt7
-rw-r--r--npc/functions/clientversion.txt12
-rw-r--r--npc/functions/util.txt10
5 files changed, 28 insertions, 15 deletions
diff --git a/npc/craft/alchemy.txt b/npc/craft/alchemy.txt
index ec268006b..ffdf34827 100644
--- a/npc/craft/alchemy.txt
+++ b/npc/craft/alchemy.txt
@@ -27,8 +27,11 @@ function script AlchemySystem {
.@var$ = requestcraft(2);
.@craft = initcraft(.@var$);
.@entry = findcraftentry(.@craft, CRAFT_ALCHEMY);
- if (debug || $@GM_OVERRIDE) mes "found craft entry: " + .@entry;
- if (debug || $@GM_OVERRIDE) mes "knowledge value: " + .knowledge[.@entry];
+ if (debug || $@GM_OVERRIDE) {
+ mes "found craft entry: " + .@entry;
+ mes "knowledge value: " + .knowledge[.@entry];
+ }
+
if (.@entry < 0) {
.success=false;
} else {
diff --git a/npc/craft/cooking.txt b/npc/craft/cooking.txt
index 09d668256..b9994351f 100644
--- a/npc/craft/cooking.txt
+++ b/npc/craft/cooking.txt
@@ -25,8 +25,11 @@ function script CookingSystem {
setskin "";
.@craft = initcraft(.@var$);
.@entry = findcraftentry(.@craft, CRAFT_COOKING); // ??????
- if (debug || $@GM_OVERRIDE) mes "found craft entry: " + .@entry;
- if (debug || $@GM_OVERRIDE) mes "knowledge value: " + .knowledge[.@entry];
+ if (debug || $@GM_OVERRIDE) {
+ mes "found craft entry: " + .@entry;
+ mes "knowledge value: " + .knowledge[.@entry];
+ }
+
if (.@entry < 0) {
.success=false;
} else {
diff --git a/npc/craft/smith.txt b/npc/craft/smith.txt
index ae7872527..972784d4e 100644
--- a/npc/craft/smith.txt
+++ b/npc/craft/smith.txt
@@ -39,8 +39,11 @@ function script SmithSystem {
.@var$ = requestcraft(4);
.@craft = initcraft(.@var$);
.@entry = findcraftentry(.@craft, CRAFT_EQUIPMENT);
- if (debug || $@GM_OVERRIDE) mes "found craft entry: " + .@entry;
- if (debug || $@GM_OVERRIDE) mes "knowledge value: " + .knowledge[.@entry];
+ if (debug || $@GM_OVERRIDE) {
+ mes "found craft entry: " + .@entry;
+ mes "knowledge value: " + .knowledge[.@entry];
+ }
+
if (.@entry < 0) {
.success=false;
} else {
diff --git a/npc/functions/clientversion.txt b/npc/functions/clientversion.txt
index 5cfa593d4..302a1c129 100644
--- a/npc/functions/clientversion.txt
+++ b/npc/functions/clientversion.txt
@@ -1426,11 +1426,13 @@ function script checkclientversion {
mesc l("Please update manually, or use the [@@%s|Mana Launcher@@] if you're on Windows or Linux.", "https://tmw2.org/launcher");
mesc l("Alternatively, download a bleeding edge build at [@@https://manaplus.germantmw.de/|https://manaplus.germantmw.de/@@]");
next;
- if (ClientVersion >= 24) mesc l("Compatibility Support mode enabled. Client may crash AT RANDOM, beware.");
- if (ClientVersion >= 24) mesc l("Crazy stuff can happen in overall. YOU HAVE BEEN WARNED TO UPDATE YOUR CLIENT.");
- if (ClientVersion >= 24) next;
- if (ClientVersion >= 24) closeclientdialog;
- if (ClientVersion >= 24) return;
+ if (ClientVersion >= 24) {
+ mesc l("Compatibility Support mode enabled. Client may crash AT RANDOM, beware.");
+ mesc l("Crazy stuff can happen in overall. YOU HAVE BEEN WARNED TO UPDATE YOUR CLIENT.");
+ next;
+ closeclientdialog;
+ return;
+ }
mesc l("You won't be allowed to play this game until you have an updated client.");
next;
// Force user to disconnect
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 2393ca1df..8f0405faa 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -26,10 +26,12 @@ function script DelItemFromEveryPlayer {
// Del items which SQL can't reach
.@c = getunits(BL_PC, .@players, MAX_CYCLE_PC);
for (.@i = 0; .@i < .@c; .@i++) {
- .@am=countitem(getarg(0), .@players[.@i]);
- if (.@am) debugmes "DELETE %d items from ACC %d", .@am, .@players[.@i];
- if (.@am)
- delitem(getarg(0), .@am, .@players[.@i]);
+ .@player = .@players[.@i];
+ .@am=countitem(getarg(0), .@player);
+ if (.@am) {
+ debugmes "DELETE %d items from ACC %d", .@am, .@player;
+ delitem(getarg(0), .@am, .@player);
+ }
}
return;
}