Skip to content

Commit

Permalink
Fix /reload not returning the correct text message (#2097)
Browse files Browse the repository at this point in the history
* Fix error with VS

* Fix spells & monsters not returning bools

* Update
  • Loading branch information
WibbenZ authored and ranisalt committed Oct 16, 2017
1 parent c8e8213 commit 5fbb12e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/baseevents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ bool BaseEvents::loadFromXml()

if (!success || !registerEvent(event, node)) {
delete event;
loaded = false;
}
}
return true;
return loaded;
}

bool BaseEvents::reload()
Expand Down
3 changes: 2 additions & 1 deletion src/monsters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,11 @@ bool Monsters::loadFromXml(bool reloading /*= false*/)
if (reloading && monsters.find(name) != monsters.end()) {
loadMonster(file, name, true);
} else {
loaded = false;
unloadedMonsters.emplace(name, file);
}
}
return true;
return loaded;
}

bool Monsters::reload()
Expand Down

8 comments on commit 5fbb12e

@Dagst
Copy link
Contributor

@Dagst Dagst commented on 5fbb12e Oct 17, 2017

Choose a reason for hiding this comment

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

After this commit the server can not start, giving error to load the scripts.

@WibbenZ
Copy link
Member Author

Choose a reason for hiding this comment

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

What is the full error? Can you take an SS?

@Dagst
Copy link
Contributor

@Dagst Dagst commented on 5fbb12e Oct 18, 2017

Choose a reason for hiding this comment

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

Tested on the server without any editing

erro monster

@ranisalt
Copy link
Member

@ranisalt ranisalt commented on 5fbb12e Oct 18, 2017

Choose a reason for hiding this comment

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

And what happened before? I suspect you have a buggy custom monster and it does not load.

If so, @WibbenZ could make another PR to make it doesn't stop loading if a single monster fails.

@Anderson0xFF
Copy link

Choose a reason for hiding this comment

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

The same thing happened to me

@Dagst
Copy link
Contributor

@Dagst Dagst commented on 5fbb12e Oct 19, 2017

Choose a reason for hiding this comment

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

I do not have any custom monster, I'm using the TFS 1.3 date with no change.

@Anderson0xFF
Copy link

Choose a reason for hiding this comment

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

Have you solved the problem yet?

I am using the original data pack

@nekiro
Copy link
Member

@nekiro nekiro commented on 5fbb12e Oct 19, 2017

Choose a reason for hiding this comment

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

I can confirm that. After this commit server wont start, it fails to load monsters.

When server starts
if (reloading && monsters.find(name) != monsters.end()) {
reloading is always false, so it will return loaded = false;

Please sign in to comment.