# HG changeset patch # User truelight # Date 1173917213 0 # Node ID 796c684ca5b6302fc41f946d9c3d7745faf8e173 # Parent 04bd925b9069defe62bfbc2cdc8dca9ee9624a7e (svn r9186) [NoAI] -Documentation: forgot to document GetInstance() -Change: make GetVM deprecated (give #warning upon use, which is a few times still) diff -r 04bd925b9069 -r 796c684ca5b6 src/ai/squirrel/core.hpp --- a/src/ai/squirrel/core.hpp Thu Mar 15 00:01:33 2007 +0000 +++ b/src/ai/squirrel/core.hpp Thu Mar 15 00:06:53 2007 +0000 @@ -74,8 +74,17 @@ */ bool CreateClassInstance(const char *class_name, void *real_instance, HSQOBJECT *instance); - HSQUIRRELVM GetVM() { return this->vm; } + /** + * Get the real-instance pointer. + * @note This will only work just after a function-call from within Squirrel + * to your C++ function. + */ static bool GetInstance(HSQUIRRELVM vm, SQUserPointer *ptr) { if (SQ_FAILED(sq_getinstanceup(vm, 1, ptr, 0))) return false; return true; } + + HSQUIRRELVM GetVM() { +#warning Please stop using this function ASAP + return this->vm; + } }; #endif /* SQUIRREL_CORE_HPP */