-
Notifications
You must be signed in to change notification settings - Fork 41
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
Science dialog not refreshed when getting a tech from a hut #2405
Comments
Entering the hut yields a random result. Apply this patch to make sure that you get the tech on entering the hut: diff --git a/data/default/default.lua b/data/default/default.lua
index f5cfc7f433..0e0532de82 100644
--- a/data/default/default.lua
+++ b/data/default/default.lua
@@ -126,30 +126,7 @@ end
-- Randomly choose a hut event
function _deflua_hut_enter_callback(unit)
- local chance = random(0, 11)
- local alive = true
-
- if chance == 0 then
- _deflua_hut_get_gold(unit, 25)
- elseif chance == 1 or chance == 2 or chance == 3 then
- _deflua_hut_get_gold(unit, 50)
- elseif chance == 4 then
- _deflua_hut_get_gold(unit, 100)
- elseif chance == 5 or chance == 6 or chance == 7 then
- _deflua_hut_get_tech(unit)
- elseif chance == 8 or chance == 9 then
- if not _deflua_hut_get_mercenaries(unit) then
- _deflua_hut_consolation_prize(unit)
- end
- elseif chance == 10 then
- alive = _deflua_hut_get_barbarians(unit)
- elseif chance == 11 then
- if not _deflua_hut_get_city(unit) then
- _deflua_hut_consolation_prize(unit)
- end
- end
-
- -- continue processing if unit is alive
+ _deflua_hut_get_tech(unit)
return (not alive)
end
|
Just a note: I suspected that this was another regression introduced by 24e44b9, but according to my tests this isn't true. |
Oh, we may need to override the Lua random to make this reproducible. In my test it was also happening with techs from treaties, which is easier to test. |
This reproducible in v3.0-patch.4 too. |
The server sends an update with Leadership completed and the current research still set to Leadership. It should be |
* Remove a special case when there are no bulbs left to research (this shouldn't happen but did in longturn#2405) * Simplify setting an empty string for observers
Upon getting a free tech, the server was sending the updated research before it was done updating the struct. The client received contradicting information (in longturn#2405, that the tech was both fully researched and still the current tech goal). Closes longturn#2405.
* Remove a special case when there are no bulbs left to research (this shouldn't happen but did in #2405) * Simplify setting an empty string for observers
Describe the bug
When getting at tech from a hut, the science dialog and the top bar are not refreshed properly
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The science shows that you got Leadership
Screenshots
Platform and version (please complete the following information):
classic
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: