Skip to content
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

adds /atom/proc/get_mob_owner() + blocks a delayed possession of item that's possessed by a player already #9128

Closed
wants to merge 11 commits into from

Conversation

EvilDragonfiend
Copy link
Member

@EvilDragonfiend EvilDragonfiend commented May 31, 2023

About The Pull Request

  • adds /atom/proc/get_mob_owner()
  • blocks a delayed possession of item that's possessed by a player already
    Bad news to players having high ping, but you'll no longer steal an item with your graced latency!

NOTE: This might need testmerge.
This is a simple code, but inherently affects the whole game in major scale.

Why It's Good For The Game

something... that shouldn't be a thing.

Testing Photographs and Procedure

Screenshots&Videos

image

get_mob_owner() proc logic. (full track case)


image

You have no issue to grab a thing


image

EMP is fine. (chameleon code change)

Note: I can't provide actual testing evidence because it needs two players to test.

Changelog

🆑
code: adds /atom/proc/get_mob_owner() - this returns a mob that possesses an atom (usually an item).
balance: Players with high latency will no longer be in favour of the latency grace. When an item is clicked by two players and it's held by a player's hand already, the another player (who has a high ping) will not steal the item immediately.
/:cl:

@EvilDragonfiend
Copy link
Member Author

Fix to do:

  • take offered item onto their hand
  • force equip on their hand

@EvilDragonfiend EvilDragonfiend marked this pull request as draft June 23, 2023 06:28
@EvilDragonfiend EvilDragonfiend marked this pull request as ready for review July 11, 2023 02:15
@EvilDragonfiend
Copy link
Member Author

Ready for review

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@@ -209,7 +209,11 @@
return FALSE

//Puts the item into our active hand if possible. returns TRUE on success.
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE)
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE, offered=FALSE)
if(!offered) // check if a clicked item is in possession of someone already unless it's offered.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a rather snowflake check for something used twice vs a proc used hundreds of places. just add this check to places setting offered = true instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted a cleaner way, but I couldn't find anything better than adding this snowflake because of how offer code works.

code/__HELPERS/atoms.dm Show resolved Hide resolved
code/modules/mob/living/living.dm Outdated Show resolved Hide resolved
code/__HELPERS/atoms.dm Outdated Show resolved Hide resolved
code/__HELPERS/atoms.dm Outdated Show resolved Hide resolved
code/__HELPERS/atoms.dm Outdated Show resolved Hide resolved
@@ -209,7 +209,11 @@
return FALSE

//Puts the item into our active hand if possible. returns TRUE on success.
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE)
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE, offered=FALSE)
if(!offered) // check if a clicked item is in possession of someone already unless it's offered.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put in nactive hand should simply put the item in your active hand and not do any of this. Add the logic to offering instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really want to do a fancier way, but offer code isn't really compatible well with this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be done a better way that is more modularised and contained

code/modules/mob/living/carbon/inventory.dm Outdated Show resolved Hide resolved
@EvilDragonfiend
Copy link
Member Author

EvilDragonfiend commented Nov 2, 2023

I reversed TRUE and FALSE, and renamed it to checks_mob_loc parameter. I hope it looks better.
This isn't possible to contain as far as I took a look onto it, but making it less snowflake-looking seems possible by having that standard parameter name...

@EvilDragonfiend
Copy link
Member Author

EvilDragonfiend commented Nov 2, 2023

and this really needs testmerge. The code is simple, but it affects extremely large amount of the game play, and I can't simulate all because of the excessive amount of the proc uses

Copy link

github-actions bot commented Jan 9, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@Rukofamicom
Copy link
Contributor

Rukofamicom commented Feb 16, 2024

Neither of the outstanding reviews have been sufficiently addressed imo
There is still a snowflake check on the put_in_active_hand proc, it just has a different name now.

Marking as stale and adding a key as well since both requests for this are months old and the coder has not found a way to fulfil the request.

🔑

@Rukofamicom Rukofamicom added the 🔑 Close Key (1/3) Indicates that someone has requested this PR to be keyed label Feb 16, 2024
@github-actions github-actions bot closed this Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Balance/Rebalance 🔑 Close Key (1/3) Indicates that someone has requested this PR to be keyed Code Improvement Feature Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants