otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.59k stars 1.06k forks source link

tile stack carpet bug #4278

Open Zbizu opened 1 year ago

Zbizu commented 1 year ago

Summary

I was coding carpet system for houses and I discovered that there is something wrong with how they are being placed in stack

Steps to reproduce

create two carpets on same tile:

  1. /i blue carpet
  2. /i brown carpet

Expected behaviour

brown carpet on top

Actual behaviour

blue carpet on top

Another example: placing two carpets in a house obraz

after saving and restarting: obraz

they get flipped every save+restart

Tofame commented 1 year ago

I can confirm that this bug is indeed existing.

Zbizu commented 1 year ago

potential fix for house loading (needs testing): https://github.com/otland/forgottenserver/blob/c274252b4a00be243564d2f1d8d86beed2bc3042/src/iomapserialize.cpp#L144

-               parent->internalAddThing(item);
+               parent->addThing(item);
ArturKnopik commented 1 year ago

how this work with more carpets? maybe we can use this behavior for "random houses", after each ss we can take top one and move it on bottom (ofc enabled by config)

feature_not_bug

EPuncker commented 1 year ago

how this work with more carpets?

well, you can (should) only put 3 carpets on same sqm, and they should keep the stack order that you added them, this is a very weird bug

Zbizu commented 1 year ago

how this work with more carpets? maybe we can use this behavior for "random houses", after each ss we can take top one and move it on bottom (ofc enabled by config) #feature_not_bug

It's a bug. Rather small sample size, but 3/3 of my testers arranged their carpet stack and found this annoying.

Answering the other question (can't quote because I'm on a phone) the placing script limits the carpets.

Tofame commented 1 year ago

how this work with more carpets? maybe we can use this behavior for "random houses", after each ss we can take top one and move it on bottom (ofc enabled by config) #feature_not_bug

@ArturKnopik maybe u understood that this is a bug in a house, but this bug happens everywhere, not only in houses. Should be fixed, not implemented as a feature.