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

Feat(events): Allow explicit 0 for events to apply directly #10054

Merged
merged 4 commits into from
May 18, 2024

Conversation

RisingLeaf
Copy link
Contributor

Feature

This PR addresses the bug/feature described in issue #6719 and as requested by @bene-dictator

Summary

Up til now events were only applied on the next increment of date. This PR allows for an explicit time to event of 0, which mean the event gets applied when the game action is triggered.
Take this example:

event "war begins"
	system Sol
		government "Free Worlds"

mission "Name2"
	job
	repeat
	on accept
		event "war begins" 0

The map changes will be seen as soon as the mission gets accepted

Testing Done

I used the test mission to test it once with explicit 0 and without, worked like expected, with explicit 0 map changes were seen directly, without I had to depart

Performance Impact

N/A

Side Note

I looked through the data files and there is no place where event gets used with a 0, so no need to change anything there.

source/PlayerInfo.cpp Outdated Show resolved Hide resolved
@TomGoodIdea TomGoodIdea added enhancement A suggestion for new content or functionality that requires code changes mechanics Things dealing with the mechanics & code of how the game works labels May 11, 2024
Copy link
Member

@TomGoodIdea TomGoodIdea left a comment

Choose a reason for hiding this comment

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

Tested changing map and player swizzle; normal events still work as they should.
Thank you!

Copy link
Member

@bene-dictator bene-dictator left a comment

Choose a reason for hiding this comment

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

The single comment in this PR looks grammatically perfect.

Thank you so much :)

literally the easiest way and performance in panels is not a bottleneck anyways
@bene-dictator
Copy link
Member

Works as expected with the Hai Start PR.

@bene-dictator bene-dictator added the waiting on dev A developer needs to do something, e.g. reviewing, merging, resolving disputes, etc. label May 12, 2024
@Amazinite Amazinite merged commit e96054d into endless-sky:master May 18, 2024
20 checks passed
@Amazinite Amazinite removed the waiting on dev A developer needs to do something, e.g. reviewing, merging, resolving disputes, etc. label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A suggestion for new content or functionality that requires code changes mechanics Things dealing with the mechanics & code of how the game works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants