summaryrefslogtreecommitdiff
path: root/src/map/instance.c
AgeCommit message (Collapse)AuthorFilesLines
2016-05-08Fixed various issues pointed out by cppcheckHaru1-4/+5
Signed-off-by: Haru <haru@dotalux.com>
2016-02-19Fix all known warnings from compiler flags -Wformat*Andrei Karas1-2/+2
Add all missing -Wformat flags into configure.
2016-01-06Replaced some explicit casts with BL_UCAST/BL_UCCASTHaru1-8/+18
- Replaced casts in foreach callbacks. - Added assertions and nullpo checks where applicable. Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Replaced some explicit casts with BL_UCAST/BL_UCCASTHaru1-1/+1
- Replaced the map-iterator related casts. Signed-off-by: Haru <haru@dotalux.com>
2016-01-06Change all TBL_PC to struct map_session_data as per style guidelineshemagx1-1/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-12-15Added GPL-compliant header to all sources and build scriptsHaru1-4/+20
Signed-off-by: Haru <haru@dotalux.com>
2015-12-05Removed some unnecessary assertionsHaru1-3/+12
- Follow-up to 81e0257 Signed-off-by: Haru <haru@dotalux.com>
2015-12-04Add missing checks to instance.cAndrei Karas1-0/+7
2015-10-24Fix crash in instance.cAndrei Karas1-2/+2
2015-10-19rename malloc.c/h to memmgr.Andrei Karas1-1/+1
2015-10-11Cleanup of the HPluginData implementation (second part)Haru1-2/+1
- Changed the hplugin_data_store's array into a VECTOR. Signed-off-by: Haru <haru@dotalux.com>
2015-10-11Cleanup of the HPluginData implementation (First part)Haru1-12/+1
- Several explicit casts are removed, to have a slightly better type-checking at compile time. - A destructor function is provided, to remove code duplication. Signed-off-by: Haru <haru@dotalux.com>
2015-09-25More aggressive whitespace cleanup. Follow up to 51329e6Haru1-51/+48
Signed-off-by: Haru <haru@dotalux.com>
2015-08-15HPM compatibility improvementsHaru1-0/+1
Improved compatibility, portability and standards conformance. - Since it is not possible to portably and reliably re-use the core's symbols in plugins, symbols are no longer exported unless explicitly required, in the UNIX builds. This mimics the Windows behavior and adds HPM compatibility to OSes such as FreeBSD. Credits to Andrei Karas for making this possible. - For convenience, it is no longer necessary to call GET_SYMBOL, since the plugin will automatically import all the available symbols when it's loaded, depending on the included headers. - Plugins are now supposed to include the "common/hercules.h" header before including anything else. Incluing common/HPMi.h, common/cbasetypes.h or conf/core.h is no longer necessary, as those are guaranteed to be automatically included by hercules.h. - HPM API version bumped to 1.1. Signed-off-by: Haru <haru@dotalux.com>
2015-08-10Add script interface function run_npc. It do same thing as run.Andrei Karas1-1/+1
2015-06-19Cleaned up some #includesHaru1-0/+1
Signed-off-by: Haru <haru@dotalux.com>
2015-06-19Removed ".." from include directivesHaru1-18/+18
- Include directives are now directory-independent. - This will allow building plugins from other directories in future. Signed-off-by: Haru <haru@dotalux.com>
2015-01-24Moved the Hercules Channel System to its own file/interfaceHaru1-1/+2
Signed-off-by: Haru <haru@dotalux.com>
2015-01-20Minor fixes and tweaks suggested by cppcheckHaru1-7/+10
- Variable scopes reduced - Parenthesized ambiguous expressions - Removed or added NULL checks where (un)necessary - Corrected format strings - Fixed typos potentially leading to bugs Signed-off-by: Haru <haru@dotalux.com>
2015-01-18Follow-up to 83077740c7c996d198617d45a1916cd31ff38e9aHaru1-0/+3
Fixed compile error in instance.c Signed-off-by: Haru <haru@dotalux.com>
2015-01-18Fixed Bug Report 8438shennetsind1-1/+10
Addresses instances crashing when running with the CELL_NOSTACK define enabled. Caused by the define not being readily available to all areas that played with mapcell (now with it being included from map.h this no longer is the case) http://hercules.ws/board/tracker/issue-8438-cell-nostack-and-instances-crash/ Signed-off-by: shennetsind <ind@henn.et>
2014-12-31Add some missing null pointer checks after automatic checks.Andrei Karas1-18/+20
2014-11-16Whitespace cleanup (no code changes)Haru1-6/+6
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>
2014-05-10Re-commit of "Fixed order of includes in all source files"Haru1-16/+18
This reverts commit 94657284973f4037596bae468ebfbee5c217e02b.
2014-05-10Revert "Fixed order of includes in all source files"panikon1-18/+16
This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/
2014-05-09Fixed order of includes in all source filesHaru1-16/+18
- Changed order according to the (upcoming) code style guidelines. - Fixes several issues caused by missing headers when their include order is changed or in plugins. Signed-off-by: Haru <haru@dotalux.com>
2014-03-05Ref redesign, part 2Haru1-7/+7
- Reorganized regs var/array DBMaps into a specific reg_db structure Signed-off-by: Haru <haru@dotalux.com>
2014-01-19HPM Custom Data Struct Expansion: map/instance/party/guildshennetsind1-0/+13
As requested by the community in http://hercules.ws/board/topic/3832-hpm-custom-data-struct-for-instance-data-guild-data-and-party-data/ Signed-off-by: shennetsind <ind@henn.et>
2014-01-11Hercules 1st 2014 MegaPatchshennetsind1-1/+4
http://hercules.ws/board/topic/3886-hercules-1st-2014-megapatch/ Signed-off-by: shennetsind <ind@henn.et>
2013-12-06HPM: mapindex interfaceshennetsind1-3/+3
Signed-off-by: shennetsind <ind@henn.et>
2013-11-05Introducing the Hercules Standalone Script Syntax CheckerHaru1-1/+4
- Added a command line argument '--script-check' to check a script's syntax without running the server (and without requiring a SQL connection). Usage: ./map-server --script-check /path/to/the/script.txt - For convenience, a script-checker bash script is provided, to set the path correctly when called from a different directory. Usage: /path/to/Hercules/script-checker /path/to/the/script/to/check.txt - While the script checker will supposedly work under windows as well, no convenience scripts are currently provided for platforms other than UNIX (feel free to open a pull request with a .bat launcher or whatever you like) - Integration with IDEs or text editors is possible. In fact, I already have a fully functional plugin for vim (through vim-syntastic), and if there's enough interest, I'll publish it. - screenshot: http://d.pr/i/NOBD - If you want an online checker, http://haru.ws/scriptchecker/ is running this code, without modifications and will be kept up to date (without any warranty though.) - Special thanks to Ind, Yommy, Streusel, who helped making this possible, in a way or another.
2013-10-26Changed 'tick' variables to 64 bitHaru1-1/+1
- This fixes an issue with timers that stop working after about 24-49 days when the tick overflows (note that this may happen much earlier than that, and at hard to predict times, on some systems) - Updated the RDTSC help message in the configure script to also warn users about issues with SpeedStep enabled systems. - On Windows, tick() still has a resolution of 10~15ms (or even as low as 100ms on some systems). A TODO comment (thanks, Ai4rei) was added for a follow-up patch, as I want this one to be as small as possible) - Note: on Windows versions earlier than 6.x (Vista, Server 2008), the tick overflow issue is NOT fixed, since they don't support the function used to retrieve a 64 bit tick. This isn't a big issue, since those platforms are already - or going soon to be - out of their extended support period, and it's already advisable to upgrade, for other reasons. If you're the unfortunate user of such a system, it is recommended that you reboot your machine at least once every 49 days for Hercules to work reliably. - Note: To clear some doubts, since I've already been asked, this has absolutely NOTHING to do with 32/64 bit CPUs or OSes. It's all about a variable's size, not the size of registers of your CPU, and your 32bit CPU will be able to handle this just fine. Signed-off-by: Haru <haru@dotalux.com>
2013-10-25Quest Bubbles Updateshennetsind1-0/+10
- Introduced questinfo cache, memory & processing speed improvement - Fixed mini-map marker support Special Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
2013-10-19Instance Dungeons Updateshennetsind1-4/+74
As requested by the community in http://hercules.ws/board/topic/1702-implement-rathena-npc/ we're merging in the latest of rAthena's dungeons, this includes the rewriting of all instance dungeons and the addition of 4 dungeons that were not present previously (BakonawaLake, BangungotHospital, BuwayaCave and OldGlastHeim). Update also includes the ability for instances to reset (or be destroyed if instance files were disabled/removed) upon @reloadscript, instance scripts are able to control to what stage the instances are to be reset via the instance_set_respawn (reload spawn) script command, OnInstanceInit labels are now triggered when the instance starts via instance_init (and upon reload), they may be used alongside instance variables (which are persistent to @reloadscript) to save players' progress. - NPC Changelog: -- npc/instances/EndlessTower.txt --- 2.2 Instance system rewrite. [Euphy] --- 2.3 Added some missing announcements. [Euphy] --- 2.4 Added GM management function. [Euphy] -- npc/instances/NydhoggsNest.txt --- 1.5 Instance system rewrite. [Euphy] --- 1.6 Added GM management NPCs. [Euphy] -- npc/instances/OrcsMemory.txt --- 1.7 Instance system rewrite. [Euphy] -- npc/instances/SealedShrine.txt --- 2.3 Instance system rewrite. [Euphy] -- npc/other/gm_npcs.txt --- 1.0 First version. [Euphy] -- npc/re/instances/BakonawaLake.txt --- 1.0 First version. [Euphy] --- 1.1 Added GM management NPC. [Euphy] -- npc/re/instances/BangungotHospital.txt --- 1.0 First version. [Euphy] --- 1.1 Added GM management function. [Euphy] -- npc/re/instances/BuwayaCave.txt --- 1.0 First version. [Euphy] -- npc/re/instances/HazyForest.txt --- 1.1 Instance system rewrite. [Euphy] -- npc/re/instances/MalangdoCulvert.txt --- 1.0b Fixed incorrect use of 'close'. [Joseph] --- 1.1 Instance system rewrite. [Euphy] -- npc/re/instances/OctopusCave.txt --- 1.1 Instance system rewrite. [Euphy] -- npc/re/instances/OldGlastHeim.txt --- 1.0 First version. [Euphy] Special Thanks to Haru, Uziel for their contributions to this update, and ossi0110 for helping us debug it. Signed-off-by: shennetsind <ind@henn.et>
2013-10-02HPM: Map.c Completedshennetsind1-92/+92
Fully Interfaced. Moved missing vars and declarations of interest into the interface, removed duplicate mentions of map within calls to shorten wherever it made sense to. Ladies and Gentleman its my pleasure to announce that with this commit we've revised all of map-server, we've learned a hell lot from this, improved many things on the go and have a number of features to be released thanks to this. *cough* hpm hooking *cough*. Signed-off-by: shennetsind <ind@henn.et>
2013-09-28HPM: Instance.c Completedshennetsind1-84/+87
Moved missing vars and declarations of interest into the interface. Instance data now available to plugins via instance->list (struct instance_data array) Signed-off-by: shennetsind <ind@henn.et>
2013-09-27Renamed iMap interface to mapHaru1-16/+16
Signed-off-by: Haru <haru@dotalux.com>
2013-09-26Renamed variables that would conflict with a rename of iMap to mapHaru1-89/+90
Note to plugin developers: if you were importing the "map", you'll need to change it to "maplist" Signed-off-by: Haru <haru@dotalux.com>
2013-09-25Merge branch 'master' of https://github.com/HerculesWS/Herculesshennetsind1-1/+1
Conflicts: src/map/chrif.c src/map/clif.c src/map/homunculus.c src/map/pet.c src/map/script.c src/map/skill.c src/map/status.c All clear.
2013-09-25Renamed iTimer interface to timer.shennetsind1-9/+9
Also removed duplicate mentions of timer within calls to shorten.
2013-09-21Fixed a potentially negative array subscript causing a mapserver crashHaru1-1/+1
- Fixes bugreport:7717, special thanks to quesoph http://hercules.ws/board/tracker/issue-7717-map-crash-when-warping-on-a-floating-npc/ - Also changed various map[foo].index to the map_id2index(foo) macro. Signed-off-by: Haru <haru@dotalux.com>
2013-09-16HPM: Npc.c Interfaceshennetsind1-2/+2
Fully Interfaced. Special Thanks to Haruna Signed-off-by: shennetsind <ind@henn.et>
2013-09-16HPM: Unit.c Interfaceshennetsind1-1/+1
Fully Interfaced Signed-off-by: shennetsind <ind@henn.et>
2013-08-20Fixed a mapserver crash when using instanced maps with custom namesHaru1-1/+1
- Fixes bugreport:7658 (thanks to purityz) http://hercules.ws/board/tracker/issue-7658-instance-mapserver-crashing/ - The crash was caused by a pointer becoming invalid when reallocating map[] (i.e. when adding maps), since 20bdc01f Signed-off-by: Haru <haru@dotalux.com>
2013-08-14Fixed Bug #7646shennetsind1-0/+55
Fixed changing map zones/flag of a instance map crashing, also added IOT_ (Instance Owner Type) constants to db/const.txt Special Thanks to purityz for all the help and test scenarios. http://hercules.ws/board/tracker/issue-7646-bg-mapflag-instance-reloadscript-mapserver-crash/ Signed-off-by: shennetsind <ind@henn.et>
2013-07-05Minor compliance adjustmentsshennetsind1-3/+3
Data provided by clang Signed-off-by: shennetsind <ind@henn.et>
2013-07-01Fixed Bug #7216shennetsind1-0/+2
Special Thanks to Shikazu, wouldn't have been able to identify this issue without his help! http://hercules.ws/board/index.php?app=tracker&showissue=7216 Signed-off-by: shennetsind <ind@henn.et>
2013-06-24Fixed Bug #7412shennetsind1-19/+26
Special Thanks to shenhuyong http://hercules.ws/board/tracker/issue-7412-create-instancereloadscript-causes-map-server-crash/ Signed-off-by: shennetsind <ind@henn.et>
2013-06-08Follow up d73783f22b2bb881aab74524d153d89a5932a199shennetsind1-2/+2
Adjusting party.c interface name to adhere with the rest (pretty much we try to make it as short as we can, and being there were no conflicts we saw no reason to maintain the 'i') Signed-off-by: shennetsind <ind@henn.et>
2013-06-08Follow up d73783f22b2bb881aab74524d153d89a5932a199shennetsind1-3/+3
Adjusting pc.c interface name to adhere with the rest (pretty much we try to make it as short as we can, and being there were no conflicts we saw no reason to maintain the 'i') Signed-off-by: shennetsind <ind@henn.et>