Fix MinClientReqCheck and improve resource upgrade #3862
+17
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Details
I found that
MinClientReqCheck
was not working on any builds because if was checkingMTASA_VERSION_TYPE
which not defined, due to a missingversion.h
import. I have restored this include in serverStdInc.h
, as it was back in the day (before a big refactor that removed this by mistake, see #3853 (comment)).Also, I changed the Resource Upgrade feature to create min_mta_version with the "both" attribute when the client & server versions to set are the same (
CResourceChecker.cpp
). Attribute "both" is already correctly supported on resource parsing/loading.Test
Tested by commenting the MTASA_VERSION_TYPE checks at MinServerReqCheck and MinClientReqCheck so this can run on custom builds:
Place this code on
client.lua
andserver.lua
script files in a new resource.Start the server to load all resources or start the resource if the server was already running.
The resource upgrader will detect the missing min_mta_version information due to this new 1.6.0 function being used, which was added in 1.6.0-9.21938 for both client and server.
The upgrade command will result in the meta.xml being successfully updated with the new "both" min_mta_version required.