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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes humans unable to use vehicle gunner seat #6247

Merged
merged 8 commits into from
May 15, 2024

Conversation

Doubleumc
Copy link
Contributor

@Doubleumc Doubleumc commented May 6, 2024

About the pull request

Fixes #6246

Explain why it's good for the game

Vehicle gunnery is meant to be used by humans.

Testing Photographs and Procedure

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

馃啈
fix: humans can use vehicle gunner seats again
/:cl:

@github-actions github-actions bot added the Fix Fix one bug, make ten more label May 6, 2024
@Drulikar Drulikar marked this pull request as draft May 6, 2024 07:50
reverts seat logic change, grants all humanoids the thumbs trait, fixes a stack-trace from double-buckling
@Doubleumc Doubleumc marked this pull request as ready for review May 6, 2024 08:39
@Doubleumc
Copy link
Contributor Author

Somewhere in the mess of ishuman(), IsAdvancedToolUser(), allow_gun_usage, has_fine_manipulation, TRAIT_OPPOSABLE_THUMBS, KNOWS_TECHNOLOGY there's a good solution.

before only humans got checked for thumbs, now all users do
Copy link
Contributor

@Drulikar Drulikar left a comment

Choose a reason for hiding this comment

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

So looking at this closer, there currently appear to be side effects of us giving this trait to humans that we need to rectify. For example,

/datum/action/item_action/can_use_action()
if(ishuman(owner) && !owner.is_mob_incapacitated())
var/mob/living/carbon/human/human = owner
if(human.body_position == STANDING_UP)
return TRUE
if((HAS_TRAIT(owner, TRAIT_OPPOSABLE_THUMBS)) && !owner.is_mob_incapacitated())
return TRUE
now makes it possible for humans to use actions while not standing, when that was not the case before. So this example either should refactor the other case to an else, or return FALSE if not standing. Though this proc could in general be refactored; e.g. both conditions both want is_mob_incapacitated, and body_position doesn't need to be for a human, its a living mob variable.

To me it seems like we could refactor this proc to below because I don't see much reason why xenos should be able to do this not standing up either (though I don't even know what actions this allows them to do):

	if(!HAS_TRAIT(owner, TRAIT_OPPOSABLE_THUMBS))
		return FALSE
	if(!isliving(owner))
		return FALSE
	var/mob/living/living_mob = owner
	if(living_mob.body_position != STANDING_UP)
		return FALSE
	return TRUE

So please take a look at the uses of TRAIT_OPPOSABLE_THUMBS and mitigate situations where a human would then fall into that xeno w/ thumbs case and have less restrictions, or maybe just consider fixing it the opposite way instead.

But maybe this then ought to just be a xeno exclusive trait and we just fix the opposite problems.

Also of note /mob/living/carbon/xenomorph/IsAdvancedToolUser() will currently return true for xenos w/ thumbs, but that also makes

if(!user.IsAdvancedToolUser() && !HAS_TRAIT(user, TRAIT_OPPOSABLE_THUMBS))
redundant...

To me it looks like these are currently problematic with the current implementation:

@Drulikar Drulikar marked this pull request as draft May 10, 2024 06:03
@Doubleumc
Copy link
Contributor Author

I agree there are likely more issues stemming from the April Fools' PR and the tangle of ishuman()/IsAdvancedToolUser()/has_fine_manipulation/TRAIT_OPPOSABLE_THUMBS cries out for a refactor, but that is way out of scope of this PR and beyond what I want to tackle at the moment.

What I have right now is:

  • add the missing TRAIT_OPPOSABLE_THUMBS to the global trait list
  • fix missing return in xeno buckling logic, no longer buckle twice
  • remove the thumbs check entirely from vehicle seats, thumbless xenos are already prevented from using the seat earlier in the proc chain

So currently humans can use the gunner seat, thumbless xenos can't use the gunner seat, thumbed xenos can use the gunner seat.

@Doubleumc Doubleumc marked this pull request as ready for review May 15, 2024 05:33
@Drulikar Drulikar added this pull request to the merge queue May 15, 2024
Merged via the queue into cmss13-devs:master with commit 6fdd3cd May 15, 2024
28 checks passed
cm13-github added a commit that referenced this pull request May 15, 2024
@Doubleumc Doubleumc deleted the vehicle-gunners-fix branch May 18, 2024 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Fix one bug, make ten more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Humans can't buckle to vehicle gunner seats
2 participants