Jump to content

A long-standing bug in the maprevealer which causes map icons to be misaligned


clearlove
  • Fixed

There is a long-standing bug with the map icons. Sometimes map icons are misaligned. These icons are sort of mirages on the map. You can see them on the map, but if you go there, these icons go away.

There is a bug in the maprevealer. The `RevealMapToPlayer` does not check whether the client is ready. I use the following codes to fix this bug:

local function handleClientPlayerJoined(player)
	print("[global position (CompleteSync)] before RPC, the player.client_is_ready is "..tostring(player.client_is_ready))
	player.client_is_ready = true
end
local modname = "dubugmaprevealer"
AddModRPCHandler(modname, "ClientPlayerJoined", handleClientPlayerJoined)

AddPrefabPostInit("world", function(inst)
	local OnMyPlayerActivated = function(world, player)
		print("[global position (CompleteSync)]Player activated")
		if not GLOBAL.TheNet:GetIsServer() then
			-- if player.userid == GLOBAL.ThePlayer.userid then
			print("[global position (CompleteSync)] sending RPC")
			SendModRPCToServer(GetModRPC(modname, "ClientPlayerJoined"))
			-- end
		else
			print("[global position (CompleteSync)] server also got activated event, but do nothing.")
		end
	end
	inst:ListenForEvent("playeractivated", OnMyPlayerActivated, GLOBAL.TheWorld)
end)

AddComponentPostInit("maprevealer", function(inst)
    inst.RevealMapToPlayer = function(self, player)
        if player.player_classified ~= nil then
            if player.client_is_ready then
                print("reavling to "..player.userid)
                print("player.client_is_ready is true before revealing")
                player.player_classified.MapExplorer:RevealArea(self.inst.Transform:GetWorldPosition())
            else
                print("reavling to "..player.userid)
                print("player.client_is_ready is false before revealing")
            end
        end
    end
end)

 

icon bug.png

wrong_icon.png


Steps to Reproduce

There are two ways to trigger the bugs of maprevealer.

  • The first way. (I test w/o dedicated server, only one player is needed)
  1. change the tick_rate to 60.
  2. Build a base, and place buildings like crock pots and ice boxes. Then build an Ice Crystaleyeze or an Ocuvigil.
  3. Disconnect, and connect again, you will see the icons of crock pots and ice boxes misaligned. 
  • The second way. (I test w/o dedicated server, you need two players)
  1. Player A, build a boat. Put a crock pot on the boat, and also an Ocuvigil. Also, build two Winged Sails.
  2. Player B went to the cave.
  3. Player A begins to drive the boat and keeps driving.
  4. Player B went to the master world from the cave.
  5. During the loading process of Player B, if the boat (and the Ocuvigil on it) is moving, Player B will see misaligned icons of crock pot on the map.

Generally, this bug does not affect normal gameplay. However, when players use the *Global Position* mod, each player becomes a map revealer, which frequently triggers this bug.

  • Sanity 3



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

I used to have that bug back couple of years ago but they fixed it by redoing the ancient map code cause it also used to make half the map blacked out by fog of war each time i relogged. Now it's all perfectly functional, but I'm surprised one of these map issues are plaguing someone else right now.

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...