Fixed 2 issues with savemap#548
Conversation
- Fixed an issue in Savemap where it didn't load from the same file path as it saved to - Fixed an issue in Savemap where it pasted too early on dedicated servers, causing some entities to not spawn at all
| print("[AdvDupe2Notify]\tMap save pasted.") | ||
| end | ||
| hook.Add("InitPostEntity", "AdvDupe2_PasteMap", PasteMap) | ||
| hook.Add("InitPostEntity", "AdvDupe2_PasteMap", timer.Simple(5,PasteMap)) |
There was a problem hiding this comment.
What's the timer for? This is a lua error btw. Should be function() timer.Simple(5, PasteMap) end
There was a problem hiding this comment.
Didn't error for me, timer is to delay the paste because on dedicated servers, trying to paste as soon as the server starts causes many things to not spawn at all
The reason its specifically "5 seconds after the first player joins" is because by default, the server pauses when noone is online, so all timers pause and only start running once a player starts joining the server, and 5 seconds should be enough time for things to be sufficiently unpaused, as it seems 1 second in my testing wasn't enough time for a few things to spawn properly
| end | ||
|
|
||
| if(not file.Exists("advdupe2/"..filename..".txt", "DATA"))then | ||
| if(not file.Exists("advdupe2/maps/"..mapname.."/"..filename..".txt", "DATA"))then |
There was a problem hiding this comment.
This should honestly just be "advdupe2/maps/"..mapname..".txt" and have the cvar deleted.
There was a problem hiding this comment.
Methinks some people might want to have multiple different saves for a single map
I think the ideal solution would be to implement some kind of save select system like the normal advdupe2 menu so you dont have to futz around with concommands, but that's out of my depth
Uh oh!
There was an error while loading. Please reload this page.