Fixed max tile number for set_map_enter_position and compilation error in Worldmap.cpp.

Added the description of get/set_map_enter_position to function notes.
This commit is contained in:
NovaRain
2018-04-27 19:40:23 +08:00
parent 310d029801
commit 57225bbd38
3 changed files with 10 additions and 4 deletions
+2 -3
View File
@@ -217,6 +217,7 @@
#define get_flags(obj) sfall_func1("get_flags", obj) #define get_flags(obj) sfall_func1("get_flags", obj)
#define get_ini_section(file, sect) sfall_func2("get_ini_section", file, sect) #define get_ini_section(file, sect) sfall_func2("get_ini_section", file, sect)
#define get_ini_sections(file) sfall_func1("get_ini_sections", file) #define get_ini_sections(file) sfall_func1("get_ini_sections", file)
#define get_map_enter_position sfall_func0("get_map_enter_position")
#define get_outline(obj) sfall_func1("get_outline", obj) #define get_outline(obj) sfall_func1("get_outline", obj)
#define intface_hide sfall_func0("intface_hide") #define intface_hide sfall_func0("intface_hide")
#define intface_is_hidden sfall_func0("intface_is_hidden") #define intface_is_hidden sfall_func0("intface_is_hidden")
@@ -231,11 +232,9 @@
#define set_dude_obj(critter) sfall_func1("set_dude_obj", critter) #define set_dude_obj(critter) sfall_func1("set_dude_obj", critter)
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags) #define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
#define set_ini_setting(setting, value) sfall_func2("set_ini_setting", setting, value) #define set_ini_setting(setting, value) sfall_func2("set_ini_setting", setting, value)
#define set_map_enter_position(tile, elev, rot) sfall_func3("set_map_enter_position", tile, elev, rot)
#define set_outline(obj, color) sfall_func2("set_outline", obj, color) #define set_outline(obj, color) sfall_func2("set_outline", obj, color)
#define set_unjam_locks_time(time) sfall_func1("set_unjam_locks_time", time) #define set_unjam_locks_time(time) sfall_func1("set_unjam_locks_time", time)
#define spatial_radius(obj) sfall_func1("spatial_radius", obj) #define spatial_radius(obj) sfall_func1("spatial_radius", obj)
#define tile_refresh_display sfall_func0("tile_refresh_display") #define tile_refresh_display sfall_func0("tile_refresh_display")
#define unjam_lock(obj) sfall_func1("unjam_lock", obj) #define unjam_lock(obj) sfall_func1("unjam_lock", obj)
#define get_map_enter_position sfall_func0("get_map_enter_position")
#define set_map_enter_position(tile, elev, rot) sfall_func3("set_map_enter_position", tile, elev, rot)
@@ -449,8 +449,14 @@ Some utility/math functions are available:
- The auto unjam mechanism will be reset each time the player reloads the game - The auto unjam mechanism will be reset each time the player reloads the game
> array sfall_func0("get_map_enter_position") > array sfall_func0("get_map_enter_position")
- returns an array of the player's position data (index 0 - tile, 1 - elevation, 2 - rotation) when entering the map through exit grids
- if entering from the world map, the tile value will be -1
- should be called in map_enter_p_proc procedure to get the correct position data
> void sfall_func3("set_map_enter_position", int tile, int elevation, int rotation) > void sfall_func3("set_map_enter_position", int tile, int elevation, int rotation)
- overrides the player's entry position when entering the map through exit grids
- setting the tile to 0 will put the player on the start hex (default tile and elevation) of the map
- works only in map_enter_p_proc procedure
------------------------ ------------------------
------ MORE INFO ------- ------ MORE INFO -------
@@ -21,6 +21,7 @@
#include "..\..\LoadGameHook.h" #include "..\..\LoadGameHook.h"
#include "..\..\ScriptExtender.h" #include "..\..\ScriptExtender.h"
#include "..\..\Worldmap.h" #include "..\..\Worldmap.h"
#include "..\Arrays.h"
#include "..\OpcodeContext.h" #include "..\OpcodeContext.h"
#include "Worldmap.h" #include "Worldmap.h"
@@ -235,7 +236,7 @@ void sf_set_map_enter_position(OpcodeContext& ctx) {
int elev = ctx.arg(1).asInt(); int elev = ctx.arg(1).asInt();
int rot = ctx.arg(2).asInt(); int rot = ctx.arg(2).asInt();
if (tile > -1 && tile <= 40200) { if (tile > -1 && tile < 40000) {
fo::var::tile = tile; fo::var::tile = tile;
} }
if (elev > -1 && elev < 3) { if (elev > -1 && elev < 3) {