Skip to content

Fix dropping items to container with tdata3/4#1414

Merged
cbnolok merged 2 commits intoSphereserver:devfrom
mtwango:fix-cont-with-tdata
May 16, 2025
Merged

Fix dropping items to container with tdata3/4#1414
cbnolok merged 2 commits intoSphereserver:devfrom
mtwango:fix-cont-with-tdata

Conversation

@mtwango
Copy link
Copy Markdown
Member

@mtwango mtwango commented May 8, 2025

This should fix part 2 of #793. Items got always 1,1 position when dropping onto container and condition checking the localtion wasn't run (sice dropping would give -1,-1 and was rewritten).

Part one (item clip) should be fixed by definining container size with tdata3/4 in scripts.

Maybe move this part from code to scripts and deprecate gettings these values with some fallback in future to 0,0,512,512 (as it is in CItemContainer::ContentAdd)?

{ GUMP_SCROLL, 30, 30, 270, 170 },

mtwango added 2 commits May 7, 2025 16:26
… (second part of Sphereserver#793)

- added check for placing items into containers with tdata3/4 with actual values instead of fixed ones
- changed generating value for random location in container with tdata3/4 to be same as without tdata3/4
- warning, if tdata4 is lower or not set and tdata3 is
@cbnolok
Copy link
Copy Markdown
Contributor

cbnolok commented May 8, 2025

What about having a fallback to the default hardcoded values, in case tdata isn't defined? With a warning message in console, of course

@mtwango
Copy link
Copy Markdown
Member Author

mtwango commented May 8, 2025

Sure, could be that way.

I was thinking about new method CEventLog::EventDeprecated with some yellowish color. It would print to the console, that this behaviour is deprecated and an alternative can be found in some place (another method, script, variable, etc.). We could pass some date or version, when it will be removed from source (and replaced with some fallback with error instead of deprecation).

But I would say that it shouldn't be part of this PR as it is beyond fixing #793.

@cbnolok
Copy link
Copy Markdown
Contributor

cbnolok commented May 9, 2025

Yes we can discuss about that new method in a separate issue. I wonder though how often would we use that

@mtwango
Copy link
Copy Markdown
Member Author

mtwango commented May 12, 2025

I've created separate issue for the deprecation discussion: #1419 so this could be merged.

@cbnolok
Copy link
Copy Markdown
Contributor

cbnolok commented May 15, 2025

What about having a fallback to the default hardcoded values, in case tdata isn't defined? With a warning message in console, of course

Sure, could be that way.

Is this going to be part of this PR, or another one?

@mtwango
Copy link
Copy Markdown
Member Author

mtwango commented May 15, 2025

I would leave it to diffferent one. There is warning if tdata4 is undefined / lower than tdata3.

For the undefined for both would be nice to have it in script pack, which I haven't done.

@cbnolok cbnolok merged commit 077e025 into Sphereserver:dev May 16, 2025
18 checks passed
@mtwango mtwango deleted the fix-cont-with-tdata branch May 16, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants