the thing that cause that to happen is because of the save system its actualy not so much of a bug just me experimenting with how i can set it up but i didn't expected that much problem with it thx for helping me figure it out i should test more
save system can be made literally any way you like.
the way i found works for me is that i make a struct containing the mose important variables (save file name, map name, respawn location or save point, array of character structs with all their stats, hp/mp, skills learned, inventory, gold, etc), plus one variable which is an array of strings/names/tags to keep track of things that can be marked complete, e.g. quests, tutorials, unlocked new areas etc. when starting a new game i put this empty save file variable in the game instance so there is only 1 and it persists when i load another map.
when loading the save i wipe EVERYTHING. basically reset the entire application by creating a new savegame object and set everything to 0 or empty (except maybe give some starter stats and gold and a wooden sword etc). load settings (graphics, volume etc) as a separate save file first, then load the file that the user chose to load, then load the map and we know which one because its in the save file, then load other things that are specific to the map like npc locations, looted boxes, things related to your quest flags or if you're in a combat map, the exact state of all the actors etc.
while playing the game, everything that will need to be saved later goes in the savegame object. your inventory, your stats, all that stuff goes in the savegame not in the characters. the characters have functions like "getCurrentHP" which read from the savegame object. when the player wants to save, you just tell this object to save and it already contains all the data that needs to be saved.