Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

640 lines
14 KiB

  1. #include "sqplus.h"
  2. #if defined(VSCRIPT_DLL_EXPORT) || defined(VSQUIRREL_TEST)
  3. #include "memdbgon.h"
  4. #endif
  5. SquirrelObject::SquirrelObject(void)
  6. {
  7. sq_resetobject(&_o);
  8. }
  9. SquirrelObject::~SquirrelObject()
  10. {
  11. if(SquirrelVM::_VM)
  12. sq_release(SquirrelVM::_VM,&_o);
  13. }
  14. SquirrelObject::SquirrelObject(SquirrelObject &o)
  15. {
  16. _o = o._o;
  17. sq_addref(SquirrelVM::_VM,&_o);
  18. }
  19. SquirrelObject::SquirrelObject(HSQOBJECT o)
  20. {
  21. _o = o;
  22. sq_addref(SquirrelVM::_VM,&_o);
  23. }
  24. void SquirrelObject::Reset(void) {
  25. if(SquirrelVM::_VM)
  26. sq_release(SquirrelVM::_VM,&_o);
  27. sq_resetobject(&_o);
  28. } // SquirrelObject::Reset
  29. SquirrelObject SquirrelObject::Clone()
  30. {
  31. SquirrelObject ret;
  32. if(GetType() == OT_TABLE || GetType() == OT_ARRAY)
  33. {
  34. sq_pushobject(SquirrelVM::_VM,_o);
  35. sq_clone(SquirrelVM::_VM,-1);
  36. ret.AttachToStackObject(-1);
  37. sq_pop(SquirrelVM::_VM,2);
  38. }
  39. return ret;
  40. }
  41. SquirrelObject & SquirrelObject::operator =(const SquirrelObject &o)
  42. {
  43. HSQOBJECT t;
  44. t = o._o;
  45. sq_addref(SquirrelVM::_VM,&t);
  46. sq_release(SquirrelVM::_VM,&_o);
  47. _o = t;
  48. return *this;
  49. }
  50. SquirrelObject & SquirrelObject::operator =(int n)
  51. {
  52. sq_pushinteger(SquirrelVM::_VM,n);
  53. AttachToStackObject(-1);
  54. sq_pop(SquirrelVM::_VM,1);
  55. return *this;
  56. }
  57. void SquirrelObject::ArrayAppend(const SquirrelObject &o)
  58. {
  59. if(sq_isarray(_o)) {
  60. sq_pushobject(SquirrelVM::_VM,_o);
  61. sq_pushobject(SquirrelVM::_VM,o._o);
  62. sq_arrayappend(SquirrelVM::_VM,-2);
  63. sq_pop(SquirrelVM::_VM,1);
  64. }
  65. }
  66. void SquirrelObject::AttachToStackObject(int idx)
  67. {
  68. HSQOBJECT t;
  69. sq_getstackobj(SquirrelVM::_VM,idx,&t);
  70. sq_addref(SquirrelVM::_VM,&t);
  71. sq_release(SquirrelVM::_VM,&_o);
  72. _o = t;
  73. }
  74. BOOL SquirrelObject::SetDelegate(SquirrelObject &obj)
  75. {
  76. if(obj.GetType() == OT_TABLE ||
  77. obj.GetType() == OT_NULL) {
  78. switch(_o._type) {
  79. case OT_USERDATA:
  80. case OT_TABLE:
  81. sq_pushobject(SquirrelVM::_VM,_o);
  82. sq_pushobject(SquirrelVM::_VM,obj._o);
  83. if(SQ_SUCCEEDED(sq_setdelegate(SquirrelVM::_VM,-2)))
  84. return TRUE;
  85. break;
  86. }
  87. }
  88. return FALSE;
  89. }
  90. SquirrelObject SquirrelObject::GetDelegate()
  91. {
  92. SquirrelObject ret;
  93. if(_o._type == OT_TABLE || _o._type == OT_USERDATA)
  94. {
  95. int top = sq_gettop(SquirrelVM::_VM);
  96. sq_pushobject(SquirrelVM::_VM,_o);
  97. sq_getdelegate(SquirrelVM::_VM,-1);
  98. ret.AttachToStackObject(-1);
  99. sq_settop(SquirrelVM::_VM,top);
  100. // sq_pop(SquirrelVM::_VM,2);
  101. }
  102. return ret;
  103. }
  104. BOOL SquirrelObject::IsNull() const
  105. {
  106. return sq_isnull(_o);
  107. }
  108. BOOL SquirrelObject::IsNumeric() const
  109. {
  110. return sq_isnumeric(_o);
  111. }
  112. int SquirrelObject::Len() const
  113. {
  114. int ret = 0;
  115. if(sq_isarray(_o) || sq_istable(_o) || sq_isstring(_o)) {
  116. sq_pushobject(SquirrelVM::_VM,_o);
  117. ret = sq_getsize(SquirrelVM::_VM,-1);
  118. sq_pop(SquirrelVM::_VM,1);
  119. }
  120. return ret;
  121. }
  122. #define _SETVALUE_INT_BEGIN \
  123. BOOL ret = FALSE; \
  124. int top = sq_gettop(SquirrelVM::_VM); \
  125. sq_pushobject(SquirrelVM::_VM,_o); \
  126. sq_pushinteger(SquirrelVM::_VM,key);
  127. #define _SETVALUE_INT_END \
  128. if(SQ_SUCCEEDED(sq_rawset(SquirrelVM::_VM,-3))) { \
  129. ret = TRUE; \
  130. } \
  131. sq_settop(SquirrelVM::_VM,top); \
  132. return ret;
  133. BOOL SquirrelObject::SetValue(INT key,const SquirrelObject &val)
  134. {
  135. _SETVALUE_INT_BEGIN
  136. sq_pushobject(SquirrelVM::_VM,val._o);
  137. _SETVALUE_INT_END
  138. }
  139. BOOL SquirrelObject::SetValue(INT key,INT n)
  140. {
  141. _SETVALUE_INT_BEGIN
  142. sq_pushinteger(SquirrelVM::_VM,n);
  143. _SETVALUE_INT_END
  144. }
  145. BOOL SquirrelObject::SetValue(INT key,FLOAT f)
  146. {
  147. _SETVALUE_INT_BEGIN
  148. sq_pushfloat(SquirrelVM::_VM,f);
  149. _SETVALUE_INT_END
  150. }
  151. BOOL SquirrelObject::SetValue(INT key,const SQChar *s)
  152. {
  153. _SETVALUE_INT_BEGIN
  154. sq_pushstring(SquirrelVM::_VM,s,-1);
  155. _SETVALUE_INT_END
  156. }
  157. BOOL SquirrelObject::SetValue(INT key,bool b)
  158. {
  159. _SETVALUE_INT_BEGIN
  160. sq_pushbool(SquirrelVM::_VM,b);
  161. _SETVALUE_INT_END
  162. }
  163. BOOL SquirrelObject::SetValue(const SquirrelObject &key,const SquirrelObject &val)
  164. {
  165. BOOL ret = FALSE;
  166. int top = sq_gettop(SquirrelVM::_VM);
  167. sq_pushobject(SquirrelVM::_VM,_o);
  168. sq_pushobject(SquirrelVM::_VM,key._o);
  169. sq_pushobject(SquirrelVM::_VM,val._o);
  170. if(SQ_SUCCEEDED(sq_rawset(SquirrelVM::_VM,-3))) {
  171. ret = TRUE;
  172. }
  173. sq_settop(SquirrelVM::_VM,top);
  174. return ret;
  175. }
  176. #define _SETVALUE_STR_BEGIN \
  177. BOOL ret = FALSE; \
  178. int top = sq_gettop(SquirrelVM::_VM); \
  179. sq_pushobject(SquirrelVM::_VM,_o); \
  180. sq_pushstring(SquirrelVM::_VM,key,-1);
  181. #define _SETVALUE_STR_END \
  182. if(SQ_SUCCEEDED(sq_rawset(SquirrelVM::_VM,-3))) { \
  183. ret = TRUE; \
  184. } \
  185. sq_settop(SquirrelVM::_VM,top); \
  186. return ret;
  187. BOOL SquirrelObject::SetValue(const SQChar *key,const SquirrelObject &val)
  188. {
  189. _SETVALUE_STR_BEGIN
  190. sq_pushobject(SquirrelVM::_VM,val._o);
  191. _SETVALUE_STR_END
  192. }
  193. BOOL SquirrelObject::SetValue(const SQChar *key,INT n)
  194. {
  195. _SETVALUE_STR_BEGIN
  196. sq_pushinteger(SquirrelVM::_VM,n);
  197. _SETVALUE_STR_END
  198. }
  199. BOOL SquirrelObject::SetValue(const SQChar *key,FLOAT f)
  200. {
  201. _SETVALUE_STR_BEGIN
  202. sq_pushfloat(SquirrelVM::_VM,f);
  203. _SETVALUE_STR_END
  204. }
  205. BOOL SquirrelObject::SetValue(const SQChar *key,const SQChar *s)
  206. {
  207. _SETVALUE_STR_BEGIN
  208. sq_pushstring(SquirrelVM::_VM,s,-1);
  209. _SETVALUE_STR_END
  210. }
  211. BOOL SquirrelObject::SetValue(const SQChar *key,bool b)
  212. {
  213. _SETVALUE_STR_BEGIN
  214. sq_pushbool(SquirrelVM::_VM,b);
  215. _SETVALUE_STR_END
  216. }
  217. // === BEGIN User Pointer, User Data ===
  218. BOOL SquirrelObject::SetUserPointer(const SQChar * key,SQUserPointer up) {
  219. _SETVALUE_STR_BEGIN
  220. sq_pushuserpointer(SquirrelVM::_VM,up);
  221. _SETVALUE_STR_END
  222. } // SquirrelObject::SetUserPointer
  223. SQUserPointer SquirrelObject::GetUserPointer(const SQChar * key) {
  224. SQUserPointer ret = NULL;
  225. if (GetSlot(key)) {
  226. sq_getuserpointer(SquirrelVM::_VM,-1,&ret);
  227. sq_pop(SquirrelVM::_VM,1);
  228. } // if
  229. sq_pop(SquirrelVM::_VM,1);
  230. return ret;
  231. } // SquirrelObject::GetUserPointer
  232. BOOL SquirrelObject::SetUserPointer(INT key,SQUserPointer up) {
  233. _SETVALUE_INT_BEGIN
  234. sq_pushuserpointer(SquirrelVM::_VM,up);
  235. _SETVALUE_INT_END
  236. } // SquirrelObject::SetUserPointer
  237. SQUserPointer SquirrelObject::GetUserPointer(INT key) {
  238. SQUserPointer ret = NULL;
  239. if (GetSlot(key)) {
  240. sq_getuserpointer(SquirrelVM::_VM,-1,&ret);
  241. sq_pop(SquirrelVM::_VM,1);
  242. } // if
  243. sq_pop(SquirrelVM::_VM,1);
  244. return ret;
  245. } // SquirrelObject::GetUserPointer
  246. // === User Data ===
  247. BOOL SquirrelObject::NewUserData(const SQChar * key,INT size,SQUserPointer * typetag) {
  248. _SETVALUE_STR_BEGIN
  249. sq_newuserdata(SquirrelVM::_VM,size);
  250. if (typetag) {
  251. sq_settypetag(SquirrelVM::_VM,-1,typetag);
  252. } // if
  253. _SETVALUE_STR_END
  254. } // SquirrelObject::NewUserData
  255. BOOL SquirrelObject::GetUserData(const SQChar * key,SQUserPointer * data,SQUserPointer * typetag) {
  256. BOOL ret = false;
  257. if (GetSlot(key)) {
  258. sq_getuserdata(SquirrelVM::_VM,-1,data,typetag);
  259. sq_pop(SquirrelVM::_VM,1);
  260. ret = true;
  261. } // if
  262. sq_pop(SquirrelVM::_VM,1);
  263. return ret;
  264. } // SquirrelObject::GetUserData
  265. BOOL SquirrelObject::RawGetUserData(const SQChar * key,SQUserPointer * data,SQUserPointer * typetag) {
  266. BOOL ret = false;
  267. if (RawGetSlot(key)) {
  268. sq_getuserdata(SquirrelVM::_VM,-1,data,typetag);
  269. sq_pop(SquirrelVM::_VM,1);
  270. ret = true;
  271. } // if
  272. sq_pop(SquirrelVM::_VM,1);
  273. return ret;
  274. } // SquirrelObject::RawGetUserData
  275. // === END User Pointer ===
  276. // === BEGIN Arrays ===
  277. BOOL SquirrelObject::ArrayResize(INT newSize) {
  278. // int top = sq_gettop(SquirrelVM::_VM);
  279. sq_pushobject(SquirrelVM::_VM,GetObjectHandle());
  280. BOOL res = sq_arrayresize(SquirrelVM::_VM,-1,newSize) == SQ_OK;
  281. sq_pop(SquirrelVM::_VM,1);
  282. // sq_settop(SquirrelVM::_VM,top);
  283. return res;
  284. } // SquirrelObject::ArrayResize
  285. BOOL SquirrelObject::ArrayExtend(INT amount) {
  286. int newLen = Len()+amount;
  287. return ArrayResize(newLen);
  288. } // SquirrelObject::ArrayExtend
  289. BOOL SquirrelObject::ArrayReverse(void) {
  290. sq_pushobject(SquirrelVM::_VM,GetObjectHandle());
  291. BOOL res = sq_arrayreverse(SquirrelVM::_VM,-1) == SQ_OK;
  292. sq_pop(SquirrelVM::_VM,1);
  293. return res;
  294. } // SquirrelObject::ArrayReverse
  295. SquirrelObject SquirrelObject::ArrayPop(SQBool returnPoppedVal) {
  296. SquirrelObject ret;
  297. int top = sq_gettop(SquirrelVM::_VM);
  298. sq_pushobject(SquirrelVM::_VM,GetObjectHandle());
  299. if (sq_arraypop(SquirrelVM::_VM,-1,returnPoppedVal) == SQ_OK) {
  300. if (returnPoppedVal) {
  301. ret.AttachToStackObject(-1);
  302. } // if
  303. } // if
  304. sq_settop(SquirrelVM::_VM,top);
  305. return ret;
  306. } // SquirrelObject::ArrayPop
  307. // === END Arrays ===
  308. SQObjectType SquirrelObject::GetType()
  309. {
  310. return _o._type;
  311. }
  312. BOOL SquirrelObject::GetSlot(INT key) const
  313. {
  314. sq_pushobject(SquirrelVM::_VM,_o);
  315. sq_pushinteger(SquirrelVM::_VM,key);
  316. if(SQ_SUCCEEDED(sq_get(SquirrelVM::_VM,-2))) {
  317. return TRUE;
  318. }
  319. return FALSE;
  320. }
  321. SquirrelObject SquirrelObject::GetValue(INT key)const
  322. {
  323. SquirrelObject ret;
  324. if(GetSlot(key)) {
  325. ret.AttachToStackObject(-1);
  326. sq_pop(SquirrelVM::_VM,1);
  327. }
  328. sq_pop(SquirrelVM::_VM,1);
  329. return ret;
  330. }
  331. FLOAT SquirrelObject::GetFloat(INT key) const
  332. {
  333. SQFloat ret = 0.0f;
  334. if(GetSlot(key)) {
  335. sq_getfloat(SquirrelVM::_VM,-1,&ret);
  336. sq_pop(SquirrelVM::_VM,1);
  337. }
  338. sq_pop(SquirrelVM::_VM,1);
  339. return ret;
  340. }
  341. INT SquirrelObject::GetInt(INT key) const
  342. {
  343. intp ret = 0;
  344. if(GetSlot(key)) {
  345. sq_getinteger(SquirrelVM::_VM,-1,&ret);
  346. sq_pop(SquirrelVM::_VM,1);
  347. }
  348. sq_pop(SquirrelVM::_VM,1);
  349. return ret;
  350. }
  351. const SQChar *SquirrelObject::GetString(INT key) const
  352. {
  353. const SQChar *ret = NULL;
  354. if(GetSlot(key)) {
  355. sq_getstring(SquirrelVM::_VM,-1,&ret);
  356. sq_pop(SquirrelVM::_VM,1);
  357. }
  358. sq_pop(SquirrelVM::_VM,1);
  359. return ret;
  360. }
  361. bool SquirrelObject::GetBool(INT key) const
  362. {
  363. SQBool ret = FALSE;
  364. if(GetSlot(key)) {
  365. sq_getbool(SquirrelVM::_VM,-1,&ret);
  366. sq_pop(SquirrelVM::_VM,1);
  367. }
  368. sq_pop(SquirrelVM::_VM,1);
  369. return ret?true:false;
  370. }
  371. BOOL SquirrelObject::Exists(const SQChar *key) const
  372. {
  373. BOOL ret = FALSE;
  374. if(GetSlot(key)) {
  375. ret = TRUE;
  376. }
  377. sq_pop(SquirrelVM::_VM,1);
  378. return ret;
  379. }
  380. ////////////////////////////////////////////////////////////////////////////////
  381. ///////////////////////////////////////////////////////////////////////////////
  382. BOOL SquirrelObject::GetSlot(const SQChar *name) const
  383. {
  384. sq_pushobject(SquirrelVM::_VM,_o);
  385. sq_pushstring(SquirrelVM::_VM,name,-1);
  386. if(SQ_SUCCEEDED(sq_get(SquirrelVM::_VM,-2))) {
  387. return TRUE;
  388. }
  389. return FALSE;
  390. }
  391. BOOL SquirrelObject::RawGetSlot(const SQChar *name) const {
  392. sq_pushobject(SquirrelVM::_VM,_o);
  393. sq_pushstring(SquirrelVM::_VM,name,-1);
  394. if(SQ_SUCCEEDED(sq_rawget(SquirrelVM::_VM,-2))) {
  395. return TRUE;
  396. }
  397. return FALSE;
  398. } // SquirrelObject::RawGetSlot
  399. SquirrelObject SquirrelObject::GetValue(const SQChar *key)const
  400. {
  401. SquirrelObject ret;
  402. if(GetSlot(key)) {
  403. ret.AttachToStackObject(-1);
  404. sq_pop(SquirrelVM::_VM,1);
  405. }
  406. sq_pop(SquirrelVM::_VM,1);
  407. return ret;
  408. }
  409. FLOAT SquirrelObject::GetFloat(const SQChar *key) const
  410. {
  411. SQFloat ret = 0.0f;
  412. if(GetSlot(key)) {
  413. sq_getfloat(SquirrelVM::_VM,-1,&ret);
  414. sq_pop(SquirrelVM::_VM,1);
  415. }
  416. sq_pop(SquirrelVM::_VM,1);
  417. return ret;
  418. }
  419. INT SquirrelObject::GetInt(const SQChar *key) const
  420. {
  421. intp ret = 0;
  422. if(GetSlot(key)) {
  423. sq_getinteger(SquirrelVM::_VM,-1,&ret);
  424. sq_pop(SquirrelVM::_VM,1);
  425. }
  426. sq_pop(SquirrelVM::_VM,1);
  427. return ret;
  428. }
  429. const SQChar *SquirrelObject::GetString(const SQChar *key) const
  430. {
  431. const SQChar *ret = NULL;
  432. if(GetSlot(key)) {
  433. sq_getstring(SquirrelVM::_VM,-1,&ret);
  434. sq_pop(SquirrelVM::_VM,1);
  435. }
  436. sq_pop(SquirrelVM::_VM,1);
  437. return ret;
  438. }
  439. bool SquirrelObject::GetBool(const SQChar *key) const
  440. {
  441. SQBool ret = FALSE;
  442. if(GetSlot(key)) {
  443. sq_getbool(SquirrelVM::_VM,-1,&ret);
  444. sq_pop(SquirrelVM::_VM,1);
  445. }
  446. sq_pop(SquirrelVM::_VM,1);
  447. return ret?true:false;
  448. }
  449. SQUserPointer SquirrelObject::GetInstanceUP(SQUserPointer tag) const
  450. {
  451. SQUserPointer up;
  452. sq_pushobject(SquirrelVM::_VM,_o);
  453. if (SQ_FAILED(sq_getinstanceup(SquirrelVM::_VM,-1,(SQUserPointer*)&up,tag))) {
  454. sq_reseterror(SquirrelVM::_VM);
  455. up = NULL;
  456. } // if
  457. sq_pop(SquirrelVM::_VM,1);
  458. return up;
  459. }
  460. BOOL SquirrelObject::SetInstanceUP(SQUserPointer up)
  461. {
  462. if(!sq_isinstance(_o)) return FALSE;
  463. sq_pushobject(SquirrelVM::_VM,_o);
  464. sq_setinstanceup(SquirrelVM::_VM,-1,up);
  465. sq_pop(SquirrelVM::_VM,1);
  466. return TRUE;
  467. }
  468. SquirrelObject SquirrelObject::GetAttributes(const SQChar *key)
  469. {
  470. SquirrelObject ret;
  471. int top = sq_gettop(SquirrelVM::_VM);
  472. sq_pushobject(SquirrelVM::_VM,_o);
  473. if(key)
  474. sq_pushstring(SquirrelVM::_VM,key,-1);
  475. else
  476. sq_pushnull(SquirrelVM::_VM);
  477. if(SQ_SUCCEEDED(sq_getattributes(SquirrelVM::_VM,-2))) {
  478. ret.AttachToStackObject(-1);
  479. }
  480. sq_settop(SquirrelVM::_VM,top);
  481. return ret;
  482. }
  483. BOOL SquirrelObject::BeginIteration()
  484. {
  485. if(!sq_istable(_o) && !sq_isarray(_o) && !sq_isclass(_o))
  486. return FALSE;
  487. sq_pushobject(SquirrelVM::_VM,_o);
  488. sq_pushnull(SquirrelVM::_VM);
  489. return TRUE;
  490. }
  491. BOOL SquirrelObject::Next(SquirrelObject &key,SquirrelObject &val)
  492. {
  493. if(SQ_SUCCEEDED(sq_next(SquirrelVM::_VM,-2))) {
  494. key.AttachToStackObject(-2);
  495. val.AttachToStackObject(-1);
  496. sq_pop(SquirrelVM::_VM,2);
  497. return TRUE;
  498. }
  499. return FALSE;
  500. }
  501. BOOL SquirrelObject::GetTypeTag(SQUserPointer * typeTag) {
  502. if (SQ_SUCCEEDED(sq_getobjtypetag(&_o,typeTag))) {
  503. return TRUE;
  504. } // if
  505. return FALSE;
  506. } // SquirrelObject::GetTypeTag
  507. const SQChar * SquirrelObject::GetTypeName(const SQChar * key) {
  508. #if 1
  509. // This version will work even if SQ_SUPPORT_INSTANCE_TYPE_INFO is not enabled.
  510. SqPlus::ScriptStringVar256 varNameTag;
  511. SqPlus::getVarNameTag(varNameTag,sizeof(varNameTag),key);
  512. SQUserPointer data=0;
  513. if (!RawGetUserData(varNameTag,&data)) {
  514. return NULL;
  515. } // if
  516. SqPlus::VarRefPtr vr = (SqPlus::VarRefPtr)data;
  517. return vr->typeName;
  518. #else // This version will only work if SQ_SUPPORT_INSTANCE_TYPE_INFO is enabled.
  519. SquirrelObject so = GetValue(key);
  520. if (so.IsNull()) return NULL;
  521. return so.GetTypeName();
  522. #endif
  523. } // SquirrelObject::GetTypeName
  524. const SQChar * SquirrelObject::GetTypeName(INT key) {
  525. SquirrelObject so = GetValue(key);
  526. if (so.IsNull()) return NULL;
  527. return so.GetTypeName();
  528. } // SquirrelObject::GetTypeName
  529. const SQChar * SquirrelObject::GetTypeName(void) {
  530. SQUserPointer typeTag=NULL;
  531. if (SQ_SUCCEEDED(sq_getobjtypetag(&_o,&typeTag))) {
  532. SquirrelObject typeTable = SquirrelVM::GetRootTable().GetValue(SQ_PLUS_TYPE_TABLE);
  533. if (typeTable.IsNull()) {
  534. return NULL; // Not compiled with SQ_SUPPORT_INSTANCE_TYPE_INFO enabled.
  535. } // if
  536. return typeTable.GetString(INT((size_t)typeTag));
  537. } // if
  538. return NULL;
  539. } // SquirrelObject::GetTypeName
  540. const SQChar* SquirrelObject::ToString()
  541. {
  542. return sq_objtostring(&_o);
  543. }
  544. SQInteger SquirrelObject::ToInteger()
  545. {
  546. return sq_objtointeger(&_o);
  547. }
  548. SQFloat SquirrelObject::ToFloat()
  549. {
  550. return sq_objtofloat(&_o);
  551. }
  552. bool SquirrelObject::ToBool()
  553. {
  554. //<<FIXME>>
  555. return _o._unVal.nInteger?true:false;
  556. }
  557. void SquirrelObject::EndIteration()
  558. {
  559. sq_pop(SquirrelVM::_VM,2);
  560. }