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

Added event type "unit placed" #563

Merged
merged 2 commits into from Jan 12, 2016

Conversation

ln-zookeeper
Copy link
Member

This is intended to allow event-driven abilities and other modifications to immediately take action when any unit appears on the map.

Still needs some more testing in context of replays and multiplayer.

@gfgtdf
Copy link
Contributor

gfgtdf commented Dec 18, 2015

You need to be carteful when calling game_events->fire(...) becasue events can basically change everything. For example it can kill other units (like killing the attacking unit in an attack event) which casues unexpected behaviour or even crashes when the c++ code assumes that these units are still there.

@ln-zookeeper
Copy link
Member Author

I think it's safe; I've tested an event which kills all created units (except leaders) and the only problem it caused was an infinite AI recruitment loop. I'll try to see if there's a way to avoid that.

I also noticed some kind of a bug involving plague which I'll need to figure out.

ln-zookeeper added a commit that referenced this pull request Jan 12, 2016
@ln-zookeeper ln-zookeeper merged commit 80691e5 into wesnoth:master Jan 12, 2016
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.

None yet

2 participants