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

npctalk: u/npc_add_effect takes int or string durations #27706

Merged
merged 1 commit into from
Jan 20, 2019

Conversation

mlangsdorf
Copy link
Contributor

@mlangsdorf mlangsdorf commented Jan 18, 2019

Summary

SUMMARY: Bugfixes "npctalk: u/npc_add_effect takes int or string durations"

Purpose of change

i-am-erk got confused and thought that the "duration" value for npc_add_effect needed to be a string even if the string wasn't "PERMANENT". It didn't, but go ahead and change the code to accept integer values encoded as strings.

Describe the solution

if "duration" is a string, read it as a string and then check if it is "PERMANENT". If it isn't, use std::stoi to convert it to an integer and pass to the set function normally.

@mlangsdorf mlangsdorf added NPC / Factions NPCs, AI, Speech, Factions, Ownership [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) labels Jan 18, 2019
@mlangsdorf
Copy link
Contributor Author

jenkins rebuild

doc/NPCs.md Outdated Show resolved Hide resolved
i-am-erk got confused and thought that the "duration" value for
npc_add_effect needed to be a string even if the string wasn't
"PERMANENT".  It didn't, but go ahead and change the code to
accept integer values encoded as strings.
@kevingranade kevingranade merged commit 745954b into CleverRaven:master Jan 20, 2019
@mlangsdorf mlangsdorf deleted the npc_add_effect_fix branch January 20, 2019 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants