summaryrefslogtreecommitdiff
path: root/src/map/instance.c
AgeCommit message (Collapse)AuthorFilesLines
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>
2013-06-07Hercules Renewal Phase One : pc, party, map, timerSusu1-29/+29
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
2013-05-30Follow up 20bdc01fa687b174a732be4483ddea4982d67ce9shennetsind1-1/+1
Fixed warnings pinpointed by mkbu95 (THANKS) Signed-off-by: shennetsind <ind@henn.et>
2013-05-30Memory Slasher - May 30 Patchshennetsind1-197/+287
http://hercules.ws/board/topic/928-memory-slasher-may-30-patch/ Signed-off-by: shennetsind <ind@henn.et>
2013-03-29Hercules Renewal: clif.cshennetsind1-6/+6
1st Phase Complete. http://hercules.ws/board/topic/237-hercules-renewal/ Signed-off-by: shennetsind <ind@henn.et>
2013-03-02Hercules Renewal: skill.cshennetsind1-1/+1
http://hercules.ws/board/topic/237-hercules-renewal/ Signed-off-by: shennetsind <ind@henn.et>
2012-12-30-Harmonize skillid, skill_num, skillnum, skill, to skill_id and same for ↵glighta1-14/+15
skill_lv -Optimise type from int to int16 in order to reduce ram consumtion. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17065 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-12-05- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).brianluau1-306/+325
[16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-25Applied AStyle code formating as discussed on tid:74602.greenboxal21-325/+306
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-10Performance Improvement; Server shut down, instance clear up, and @cleanmap ↵shennetsind1-1/+1
are now all faster. Instead of wasting time doing a dbmap lookup (of a data it already possessed!) on each floor item being deleted, it'll use the data to clean the item. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16901 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-31Fixed bugreport:5804 Instances no longer leave "broken" timers behind. ↵shennetsind1-0/+3
Instances also will destroy themselves upon @reloadscript since they break at that. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16183 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-05-26Fixed bugreport:5658 Instance NPCs will now be cleared properly. ↵shennetsind1-1/+29
Super-Special Thanks to Pig321 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16153 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-28- Fixed an issue with the instance variable storage system never being ↵epoque111-17/+4
initialised (since unknown revision) - Combined both string and integer instance variables into a single DBMap* structure - Fixed a missing new-line at the end of src/common/conf.h causing warnings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15998 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-04-28- Updated the script engine to make use of the DBMap* structure for storing ↵epoque111-5/+2
variables (for Ind <3) - Fixed missing new-lines at the end of various files causing warnings git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15997 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-02-16- Removed outdated version number handling (follow-up to r11503).gepard19841-1/+0
- Fixed mapcache compilation issues in Linux. - Added some missing `svn:ignore` properties. - Moved `BLOCK_SIZE` definition from header to source file. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15586 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-30- Removed more trailing tabs.brianluau1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15527 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-01-22Minor cleanups, mostly reducing scopes.xazax-hun1-2/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15504 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-02* More instancing updates.ai4rei1-18/+33
- Improved instance_id validity checking. - Fixed instance name being copied with memcpy rather than safestrncpy (since r13901). - Removed unused instance data field 'progress_timeoutval' (since r13901). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14879 54d463be-8e91-2dee-dedb-b68131a5f0ec