Skip to content

Commit ca625d5

Browse files
committed
Minor fix in Worldmap.cpp
Added pickup item message for sfall_mods.ssl script. Update release version to 4.1.9.1
1 parent eee52f8 commit ca625d5

File tree

5 files changed

+29
-19
lines changed

5 files changed

+29
-19
lines changed

artifacts/config_files/sfall-mods.ini

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ DropItemsOnDeath=0
4747
; 34 - G key
4848
PickupItemKey=0
4949

50+
;Messages
51+
PickupItemMsg=You pickup: %s.
52+
5053
[CombatControl]
5154
;Allows you to directly control other critters in combat
5255
;Set to 0 to disable

artifacts/mods/gl_sfall-mods.ssl

+14-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ procedure InventoryMoveHandler;
2323
procedure KeyPressHandler;
2424

2525
procedure pickup_ground_items;
26-
procedure pickup_info();
26+
procedure pickup_clear();
2727
procedure distance_sort(variable array);
2828
procedure weapon_drop;
2929
procedure DeathAmimHandler;
3030

3131
variable quickAmmoReload, pickupKey, keyMod, pickupItem, temp;
3232
variable deathNpcArray, countDeath;
33+
variable pickupMessage;
3334

3435
procedure start begin
3536
variable sfall_version;
@@ -43,6 +44,7 @@ procedure start begin
4344

4445
if (sfall_version >= 414) then begin
4546
pickupKey := GetConfig("Inventory", "PickupItemKey", 0);
47+
if (pickupKey > 0) then pickupMessage := GetConfigStr("Inventory", "PickupItemMsg", "Error");
4648

4749
if ((GetConfig("Inventory", "QuickAmmoReload", 0) > 0)
4850
and GetIniConfig("Misc", "ReloadReserve", -1, "ddraw.ini") > -1) then begin
@@ -101,6 +103,12 @@ procedure InventoryMoveHandler begin
101103
set_weapon_ammo_count(ammoObj, cAmmo);
102104
add_obj_to_inven(inven, ammoObj);
103105
end
106+
else if (event == 7) then begin
107+
if (pickupItem and pickupItem == itemDrop) then begin
108+
display_msg(sprintf(pickupMessage, obj_name(itemDrop)));
109+
end
110+
pickupItem := 0;
111+
end
104112
else if (event == 8) then begin
105113
if (obj_item_subtype(itemDrop) == item_type_drug) then begin
106114
set_self(dude_obj);
@@ -137,7 +145,7 @@ procedure KeyPressHandler begin
137145
else if (keyDX == DIK_Z and (mode bwand PIPBOY)) then begin
138146
tap_key(DIK_ESCAPE);
139147
end
140-
else if (not(pickupItem) and keyDX == pickupKey and (mode == 0)) then begin
148+
else if (keyDX == pickupKey and (mode == 0)) then begin
141149
call pickup_ground_items;
142150
end
143151
else if (keyMod and keyDX == DIK_A and (mode bwand (COMBAT bwor PCOMBAT))) then begin
@@ -173,18 +181,17 @@ procedure pickup_ground_items begin
173181

174182
// pickup object
175183
set_self(dude_obj);
176-
pickup_obj(item);
177184
pickupItem := item;
178-
walkDist /= 2;
179-
call pickup_info in walkDist;
185+
pickup_obj(item);
186+
//walkDist /= 2;
187+
call pickup_clear in 3;
180188
break; // exit loop
181189
end
182190
end
183191
if weight == -1 then display_msg(mstr_misc(8000)); // You carry too much
184192
end
185193

186-
procedure pickup_info() begin
187-
display_msg(sprintf(mstr_misc(8002), obj_name(pickupItem)));
194+
procedure pickup_clear() begin
188195
pickupItem := 0;
189196
end
190197

artifacts/scripting/sfall function notes.txt

+5-4
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,12 @@ optional arguments:
612612

613613
> int sfall_func1("add_extra_msg_file", string fileName)
614614
> int sfall_func2("add_extra_msg_file", string fileName, int fileNumber)
615-
- Loads the custom message file, and returns the identification number assigned to it in range from 0x3000 to 0x3FFF for accessing messages via the message_str_game script function
616-
- fileName: the name of the message file (including the .msg extension) located in the game directory "text\<current_lang>\game\"
615+
- loads the custom message file, and returns the file ID number assigned to it in range from 0x3000 to 0x3FFF for the message_str_game function to get messages from the file
616+
- fileName: the name of the custom message file (including the .msg extension) in "text\<language>\game\" directory
617617
optional argument:
618-
- fileNumber: file number ID for accessing, available number range from 0x2000 to 0x2FFF (see ExtraGameMsgFileList option)
619-
use fileNumber only if you want to adding a message file without editing ddraw.ini or existing scripts to support the old way
618+
- fileNumber: the file ID number for the message_str_game function. The available range is from 0x2000 to 0x2FFF (see ExtraGameMsgFileList setting in ddraw.ini)
619+
use fileNumber only if you want to add a message file without editing ddraw.ini or existing scripts to support the old way
620+
620621
------------------------
621622
------ MORE INFO -------
622623
------------------------

sfall/Modules/Scripting/Handlers/Worldmap.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void sf_set_rest_on_map(OpcodeContext& ctx) {
266266
return;
267267
}
268268
long elev = ctx.arg(1).asInt();
269-
if (elev < -1 && elev > 2) {
269+
if (elev < -1 || elev > 2) {
270270
ctx.printOpcodeError("%s() - invalid map elevation argument.", ctx.getMetaruleName());
271271
} else {
272272
Worldmap::SetRestMapLevel(mapId, elev, ctx.arg(2).asBool());
@@ -275,7 +275,7 @@ void sf_set_rest_on_map(OpcodeContext& ctx) {
275275

276276
void sf_get_rest_on_map(OpcodeContext& ctx) {
277277
long elev = ctx.arg(1).asInt();
278-
if (elev < 0 && elev > 2) {
278+
if (elev < 0 || elev > 2) {
279279
ctx.printOpcodeError("%s() - invalid map elevation argument.", ctx.getMetaruleName());
280280
} else {
281281
ctx.setReturn(Worldmap::GetRestMapLevel(elev, ctx.arg(0).asInt()));

sfall/version.h

+5-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
#define LEGAL_COPYRIGHT "Copyright © 2006-2019, sfall team"
2424

2525
#define VERSION_MAJOR 4
26-
#define VERSION_MINOR 2
27-
#define VERSION_BUILD 0
28-
#define VERSION_REV 0
26+
#define VERSION_MINOR 1
27+
#define VERSION_BUILD 9
28+
#define VERSION_REV 1
2929

30-
#define VERSION_STRING "4.2.0"
31-
32-
//#define CHECK_VAL (4)
30+
#define VERSION_STRING "4.1.9.1"
3331

32+
//#define CHECK_VAL (4)

0 commit comments

Comments
 (0)