fix #460 - /give_exp targeting wrong player

This commit is contained in:
Marvin Altemeier 2020-02-10 10:38:45 +01:00
parent 6424ca7947
commit 787e5a6e49
2 changed files with 4 additions and 2 deletions

View File

@ -16,8 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Allow spawning individual pet species, not just generic body kinds.
### Changed
- Brighter / higher contrast main-map
- Removed highlighting of non-collectible sprites
- Fixed /give_exp ignoring player argument
### Removed

View File

@ -1027,8 +1027,8 @@ fn handle_exp(server: &mut Server, entity: EcsEntity, args: String, action: &Cha
let mut error_msg = None;
match opt_player {
Some(_alias) => {
if let Some(stats) = ecs.write_storage::<comp::Stats>().get_mut(entity) {
Some(player) => {
if let Some(stats) = ecs.write_storage::<comp::Stats>().get_mut(player) {
stats.exp.change_by(exp);
} else {
error_msg = Some(ServerMsg::private(String::from("Player has no stats!")));