Jump to content

Putting the "entity" of "AddLabel" into the magic box will cause the game to crash


nicework
  • Closed

Many modules add labels to entities, such as fish school names, relationship displays, and nickname displays. When entities with labels are placed in containers such as Magic Box and Shadow Chester, it can directly cause the game to crash.

 

I will use code to implement the situation I described. During this period, it can be replicated without installing any modules. You can see it in the "client_log. txt" section below. There are no extra logs, so simply flash back.


Steps to Reproduce

For example, my husband becomes a bee and "adds label" to it, which crashes directly after being placed in a magic box

Reference code:

```LUA

player_pos = ThePlayer:GetPosition()
enttable = TheSim:FindEntities(player_pos.x, 0, player_pos.z, 1)
for _,ent in pairs(enttable)do
if ent.prefab == "bee" then
 b = ent
 print(ent)
end
end
l = b.entity:AddLabel()
l:SetColour(unpack(PLAYERCOLOURS.CORAL))
l:SetWorldOffset(0, 1, 0)
l:SetFont(CHATFONT_OUTLINE)
l:SetFontSize(16)
l:Enable(true)
l:SetText("test")

```

This bee will have the word "test" on it. Catch this bee and the player will also have this word. After completing these tasks, placing the bee in the magic box will directly cause the client to crash




User Feedback


AddLabel from entity was made for debugging edge cases will crop up as it is and mods using it should take care about edge cases that crop up.

Changed Status to Closed

  • Like 2

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...