Skip to content
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

CAN_I_DAMAGEABLE not updating status bar #1259

Closed

Conversation

GladieUO
Copy link
Contributor

@GladieUO GladieUO commented Jul 4, 2024

Another attempt for the small fix. #1248 also together with this we should consider #1260
The status bar would not get updated when you lower hits on the item with the flag.

Only way it would get updated is:

  1. reopening status
  2. changing some value on item (like MORE1 ++)
  3. Targeting item by whatever

cbnolok and others added 15 commits June 17, 2024 18:53
…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
while using EF_FollowerList
Sphereserver#1251
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.
By changing hits on item with can_i_damageable the status bar wouldnt get updated automatically.
You had to reopen the status, change some value like more2 or target the item.
@Tolokio
Copy link
Contributor

Tolokio commented Jul 16, 2024

does that fix works?

@GladieUO
Copy link
Contributor Author

does that fix works?

does for me. Everytime the hits gets changed from the custom script, statusbar updated. Before it didnt. If its correct fix im not sure.

@Tolokio
Copy link
Contributor

Tolokio commented Jul 16, 2024

Confirmed bug and confirmed that Gladie's fix works. But you lack the fix as well for maxhits
image

I dont know if it is how it should be fixed but works.

Anyway, I found something weird. maybe is normal I dont know.

image
image

@GladieUO
Copy link
Contributor Author

GladieUO commented Jul 16, 2024

I wasnt sure if we need to have it update on maxhits. Maybe if there is like 50/100 hits and you decrease maxhits to 75 so the ratio of status would change too?
I will update the PR.

same fix like for HITS, only missed the MAXHITS
@Tolokio
Copy link
Contributor

Tolokio commented Jul 17, 2024

I wasnt sure if we need to have it update on maxhits. Maybe if there is like 50/100 hits and you decrease maxhits to 75 so the ratio of status would change too? I will update the PR.

You should split commits because there is a fix for follower slots.

Well, I think maxhits could be set after the item is created and placed in the world so..., and custom scripts could need it too. For example, a repair system that reduces maxhits but sets hits to 100%

I think u can force the ticks just giving a timer to the item. let me check. tested, Nopes u can't,

Not sure if this is the way. I think so, but I confirm the fix works.

@GladieUO
Copy link
Contributor Author

I wasnt sure if we need to have it update on maxhits. Maybe if there is like 50/100 hits and you decrease maxhits to 75 so the ratio of status would change too? I will update the PR.

You should split commits because there is a fix for follower slots.

I Made new branch for this fix but somehow it shows also the followerslots I dunno why 🤐

@Tolokio
Copy link
Contributor

Tolokio commented Jul 17, 2024

U need to do a branch from source-x instead from ur own fork.
image

Then do the changes on that branch and pull. Remember u need to edit changelog as well.

DavideRei and others added 4 commits July 20, 2024 12:26
…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.
@cbnolok cbnolok changed the base branch from master to dev July 20, 2024 12:11
- Fixed: ini CommandPrefix being overwritten by data from other ini settings.
- Fixed: function call stack sometimes being subject to a race condition between two writing threads, corrupting it.
- Fixed: lots of memory corruption errors leaving the server unstable when loading a broken save file and recovering by loading a backup save.
- Fixed: CCacheableScriptFile sometimes not reading the last character.
- Fixed: .clang_format.
- Changed: RES_GET_INDEX macro to ResGetIndex function, allowing more integer type safety. Same for RES_GET_TYPE.
- Changed: Renamed THREAD_* macros to MT_*. Split them in always active macros (MT_*) and macros active only when MT_ENGINE is set to 1 (MT_ENGINE_*). There are some situations where we still need a mutex
even if not working with multithreaded script/networking engines (which are NOT complete).
- Changed: Disable signal handlers under Linux if running with ASAN or a debugger.
- Added: NOEXCEPT_DEBUG, it's simply the noexcept specifier, but it's ignored if running in a debug build (useful if we're using DEBUG_ASSERT inside a function which wouldn't otherwise throw an exception).
- Fixed: some undefined behaviors, like signed to unsigned conversion and vice versa.
- Added: additional checks for GCC and Clang ASAN builds.
@cbnolok
Copy link
Contributor

cbnolok commented Jul 31, 2024

Did you manage to remove the FOLLOWERSLOTS change from this PR?

This reverts commit fa87433.
@GladieUO
Copy link
Contributor Author

Did you manage to remove the FOLLOWERSLOTS change from this PR?

I think I managed to do it right now.

@cbnolok
Copy link
Contributor

cbnolok commented Aug 10, 2024

I'm sorry, could you fix the conflicts please?

@GladieUO
Copy link
Contributor Author

I'm sorry, could you fix the conflicts please?

should be done

@cbnolok
Copy link
Contributor

cbnolok commented Aug 10, 2024

Manually merged.

@cbnolok cbnolok closed this Aug 10, 2024
@GladieUO GladieUO deleted the can_i_damageable-status-update branch August 10, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants