Permalink
Browse files

Fixed a sanity condition in the script function pointer reader.

The condition could never be false, and never returned an empty
object in that case.

This alone doesn't fix the crashes seen with the Stun Strike,
or in fact with failing battle status effects triggered a second
time, but it can't hurt.
  • Loading branch information...
1 parent 5ccd4cd commit 55c6ef348d0bf13619b3fbbff7abc845bdbf1dad Yohann Ferreira committed Sep 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/engine/script/script_read.cpp
@@ -228,7 +228,7 @@ object ReadScriptDescriptor::ReadFunctionPointer(const std::string& key) {
luabind::object o(from_stack(_lstack, STACK_TOP));
- if (!o) {
+ if (!o.is_valid()) {
IF_PRINT_WARNING(SCRIPT_DEBUG) << "failed because it was unable to access the function "
<< "for the global key: " << key << std::endl;
return luabind::object();

0 comments on commit 55c6ef3

Please sign in to comment.