-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dragon breath on @NPCSpecialAction #1265
Conversation
…efault container from map of vectors to a multimap, also trying to delete elements as little as possible, to avoid cpu usage, reallocations and tree rebalancing). Added #define MT_ENGINES: it doesn't make sense to keep unneeded mutex locks, at least until (if ever) we'll have a fully multithreaded engine. Some advancement in making ASAN work on Windows with Clang. Added .cmake-format
Reduced CSector member data types as needed, to save memory. Added a security check to CSFile::r_Write, at shutdown there might be a request to write to an invalid file descriptor (tested on Linux, tried to write on fd -1). Added macro SECTORSIZE_DEFAULT instead of using 64 as a magic number.
…dynamically allocating memory for it each time, pre-allocate and request cached CWorldSearch instances. Use CWorldSearch::GetInstance(). Added cdrc external library (reference counted smart pointers, std::shared_ptr is too slow) and new CSReferenceCount sphere library. Cdrc has been slightly modified in order to be used and compiled in a multi-file project. See custom folder. Added HAS_FLAGS_STRICT and HAS_FLAGS_ANY macros. Fixed macOS compilation error.
CWorldSearchHolder now uses CSReferenceCount instead of rc_ptr, which is more complex and slightly slower. Modified some ADDTOCALLSTACK calls for frequently called functions. Changed some rand val generations in CCharFight to use the fast algorithm. Inlined some small functions.
Fixed some Linux compilation warnings and errors. MSVC will compile by default with SSE2 CPU extensions enabled on x86_64. Updated CMakeDetectArch.cmake with 3rd party code.
…significantly reduced CPU usage and (slightly) reduced startup time. - Fixed: RAM usage always increasing during uptime. Caused by a couple of memory leaks, the greatest happening because the cached map blocks were not properly released. - Fixed: adopted a more conservative memory allocation policy for strings, resulting in reduced RAM usage. - Changed: I_MEMORY (ITEMID_MEMORY) items won't have anymore the ComponentProps Faction, ItemChar, Item, reducing their memory footprint.
…umber with a different base (seconds or tenths of seconds or milliseconds) in different contexts. Now they expect in scripts only values in seconds. Fixed: crash when moving a char in an area full of teleporters, or whichever items made the char move multiple times in the same tick. Fixed: buffer read past the end in CCacheableScriptFile first reading. Fixed: if a char had the COMM_CRYSTAL flag enabled, it called ::OnHear on every item in range, without checking if the item is actually capable of hearing. Further optimized distance checks. Separated the Github workflows into different files, in order to get a different badge for each build platform/type. Dismissed AppVeyor build. Added sphere_library/sfastmath.h.
Fixeid an invalid memory read when reading the last script file line.
Added more log messages for Linux x86 build and Coverity upload workflow.
abe8b2a
to
5e2aca3
Compare
…ags. (Sphereserver#1237) Fixed duration of hallucination spell. Fixed wrong layer for potion delay. Fixed wrong sound id for changing monster sounds schema. Fixed Attacker_GetHighestThreat: return -1 would make the NPC threat lesser than the ATTACKER_THREAT_TOLDBYMASTER and make CChar::NPC_GetAttackMotivation not work correctly for attacking pets. Fixed NPC_Act_Follow use combat target even if the npc is not in combat.
Could you explain better the need of argo? Also, can we do the stam check via scripts directly instead of hardcoding it? One might want to increase the stam requirement, or use mana or nothing instead. |
Trigger is use 2 place in the source: Argo is needed on dragon breath because you need to know the target. On the other place (where every wandering NPC ) the trigger appear, no argonis require because there no target. BUT, since I use Argo on my script, I have a invalid argo error each time I use the trigger. The way I found to fix is adding argo to everybone on the trigger. About the stam, it's not the dragon breath itself consuming stam... Nocspecialaction trigger appear BEFORE the breath. If you set return 1, breath is cancel and next tick the dragon will try again to breath because he his full stam. So the dragon will just freeze for ethernity. The workaround to block this freeze was to consume 1 stam. |
0913018
to
7a9a90c
Compare
Uhm wait, two questions. First, couldn't you use ARGO.ISVALID to avoid errors? |
Added a new feature about NPC special action.
I tested it well and it work nicely. The bug I had was if you set return 1 when dragon breath, dragon was stuck and always retest to send breath.
I just added a 1 stamina consumption and all work well!