Basic style fixes.
This commit is contained in:
parent
7a9f9ab744
commit
5e198c6730
@ -33,9 +33,7 @@
|
||||
|
||||
|
||||
|
||||
/****************************
|
||||
* Better error reporting for Lua
|
||||
**/
|
||||
// Better error reporting for Lua
|
||||
static int tolua_do_error(lua_State* L, const char * a_pMsg, tolua_Error * a_pToLuaError)
|
||||
{
|
||||
// Retrieve current function name
|
||||
@ -81,10 +79,7 @@ static int lua_do_error(lua_State* L, const char * a_pFormat, ...)
|
||||
|
||||
|
||||
|
||||
/****************************
|
||||
* Lua bound functions with special return types
|
||||
**/
|
||||
|
||||
// Lua bound functions with special return types
|
||||
static int tolua_StringSplit(lua_State * tolua_S)
|
||||
{
|
||||
cLuaState LuaState(tolua_S);
|
||||
@ -557,10 +552,12 @@ static int tolua_DoWithXYZ(lua_State* tolua_S)
|
||||
|
||||
|
||||
|
||||
template< class Ty1,
|
||||
template<
|
||||
class Ty1,
|
||||
class Ty2,
|
||||
bool (Ty1::*Func1)(int, int, cItemCallback<Ty2> &) >
|
||||
static int tolua_ForEachInChunk(lua_State* tolua_S)
|
||||
bool (Ty1::*Func1)(int, int, cItemCallback<Ty2> &)
|
||||
>
|
||||
static int tolua_ForEachInChunk(lua_State * tolua_S)
|
||||
{
|
||||
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
|
||||
if ((NumArgs != 3) && (NumArgs != 4))
|
||||
@ -651,9 +648,11 @@ static int tolua_ForEachInChunk(lua_State* tolua_S)
|
||||
|
||||
|
||||
|
||||
template< class Ty1,
|
||||
template<
|
||||
class Ty1,
|
||||
class Ty2,
|
||||
bool (Ty1::*Func1)(cItemCallback<Ty2> &) >
|
||||
bool (Ty1::*Func1)(cItemCallback<Ty2> &)
|
||||
>
|
||||
static int tolua_ForEach(lua_State * tolua_S)
|
||||
{
|
||||
int NumArgs = lua_gettop(tolua_S) - 1; /* This includes 'self' */
|
||||
|
@ -42,10 +42,7 @@ public:
|
||||
// Called each tick
|
||||
virtual void Tick(float a_Dt) = 0;
|
||||
|
||||
/**
|
||||
* On all these functions, return true if you want to override default behavior and not call other plugins on that callback.
|
||||
* You can also return false, so default behavior is used.
|
||||
**/
|
||||
/** Calls the specified hook with the params given. Returns the bool that the hook callback returns.*/
|
||||
virtual bool OnBlockSpread (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, eSpreadSource a_Source) = 0;
|
||||
virtual bool OnBlockToPickups (cWorld * a_World, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cItems & a_Pickups) = 0;
|
||||
virtual bool OnChat (cPlayer * a_Player, AString & a_Message) = 0;
|
||||
|
@ -51,9 +51,11 @@ class cBlockEntityWithItems;
|
||||
|
||||
|
||||
|
||||
class cPluginManager // tolua_export
|
||||
{ // tolua_export
|
||||
public: // tolua_export
|
||||
// tolua_begin
|
||||
class cPluginManager
|
||||
{
|
||||
public:
|
||||
// tolua_end
|
||||
|
||||
// Called each tick
|
||||
virtual void Tick(float a_Dt);
|
||||
@ -164,8 +166,10 @@ public: // tolua_export
|
||||
cPlugin * GetPlugin( const AString & a_Plugin ) const; // tolua_export
|
||||
const PluginMap & GetAllPlugins() const; // >> EXPORTED IN MANUALBINDINGS <<
|
||||
|
||||
void FindPlugins(); // tolua_export
|
||||
void ReloadPlugins(); // tolua_export
|
||||
// tolua_begin
|
||||
void FindPlugins();
|
||||
void ReloadPlugins();
|
||||
// tolua_end
|
||||
|
||||
/** Adds the plugin to the list of plugins called for the specified hook type. Handles multiple adds as a single add */
|
||||
void AddHook(cPlugin * a_Plugin, int a_HookType);
|
||||
|
@ -64,14 +64,14 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest
|
||||
std::pair< AString, AString > Names;
|
||||
AStringVector Split = StringSplit(a_Request->Path, "/");
|
||||
|
||||
if( Split.size() > 1 )
|
||||
if (Split.size() > 1)
|
||||
{
|
||||
sWebPluginTab* Tab = 0;
|
||||
if( Split.size() > 2 ) // If we got the tab name, show that page
|
||||
sWebPluginTab * Tab = NULL;
|
||||
if (Split.size() > 2) // If we got the tab name, show that page
|
||||
{
|
||||
for( TabList::iterator itr = GetTabs().begin(); itr != GetTabs().end(); ++itr )
|
||||
{
|
||||
if( (*itr)->SafeTitle.compare( Split[2] ) == 0 ) // This is the one! Rawr
|
||||
if ((*itr)->SafeTitle.compare(Split[2]) == 0) // This is the one!
|
||||
{
|
||||
Tab = *itr;
|
||||
break;
|
||||
@ -84,7 +84,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest
|
||||
Tab = *GetTabs().begin();
|
||||
}
|
||||
|
||||
if( Tab )
|
||||
if (Tab != NULL)
|
||||
{
|
||||
Names.first = Tab->Title;
|
||||
Names.second = Tab->SafeTitle;
|
||||
@ -97,7 +97,7 @@ std::pair< AString, AString > cWebPlugin::GetTabNameForRequest(const HTTPRequest
|
||||
|
||||
|
||||
|
||||
AString cWebPlugin::SafeString( const AString & a_String )
|
||||
AString cWebPlugin::SafeString(const AString & a_String)
|
||||
{
|
||||
AString RetVal;
|
||||
for( unsigned int i = 0; i < a_String.size(); ++i )
|
||||
@ -111,3 +111,7 @@ AString cWebPlugin::SafeString( const AString & a_String )
|
||||
}
|
||||
return RetVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user