Guest User

Untitled

a guest
Nov 19th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. //Before
  2.  
  3. LuaScriptInterface(const std::string& interfaceName);
  4.  
  5. //Add this
  6.  
  7. static void setFieldBool(lua_State* L, const char* index, bool value);
  8. static int32_t luaDoPlayerSetCastPassword(lua_State* L);
  9. static int32_t luaDoPlayerSetCastState(lua_State* L);
  10. static int32_t luaGetPlayerCast(lua_State* L);
  11.  
  12. //After
  13.  
  14. static void pushCallback(lua_State* L, int32_t callback);
  15.  
  16. //Add this
  17.  
  18. static bool popBoolean(lua_State* L);
  19.  
  20. //After
  21.  
  22. static Player* getPlayer(lua_State* L, int32_t arg);
  23.  
  24. //Add this
  25.  
  26. template<typename T> //Cast System Felipe Monteiro
  27. static T popNumber(lua_State* L) { //Cast System Felipe Monteiro
  28. if (lua_gettop(L) == 0) {
  29. return static_cast<T>(0);
  30. }
  31.  
  32. T ret = static_cast<T>(lua_tonumber(L, -1));
  33. lua_pop(L, 1);
  34. return ret;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment