minetest-mapserver / mapserver_mod

Complementary mod for the minetest mapserver
17 stars 14 forks source link

fixed Undeclared global variable QoS #16

Closed MilesBDyson closed 3 years ago

MilesBDyson commented 3 years ago

;)

BuckarooBanzay commented 3 years ago

looks good, but i think the local QoS will shadow the global variable and render it useless in any case :P fixing that in a follow-up commit :+1:

BuckarooBanzay commented 3 years ago

i've corrected it with this:

local http = minetest.request_http_api()
if minetest.get_modpath("qos") and http then
        -- use qos-wrapped http
        http = QoS(http, 2)
end

This way the QoS variable only gets accessed if it is defined and the "undeclared variable" warning shouldn't pop up

MilesBDyson commented 3 years ago

i was wondering about that but i did not see any major issues when i mad the changes on a test server, it seamed to work but i was unsure if it was correct but thank you for correcting it. ;)