Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- comparing with https://code.google.com/p/bitfighter/
- searching for changes
- diff -r da40340a2909 -r 70cdfe0ad762 zap/CoreGame.cpp
- --- a/zap/CoreGame.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/CoreGame.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -279,33 +279,15 @@
- setStartingHealth(F32(CoreDefaultStartingHealth) / DamageReductionRatio); // Hits to kill
- mHasExploded = false;
- +
- mHeartbeatTimer.reset(CoreHeartbeatStartInterval);
- mCurrentExplosionNumber = 0;
- +
- mPanelGeom.isValid = false;
- mKillString = "crashed into a core"; // TODO: Really needed?
- LUAW_CONSTRUCTOR_INITIALIZATIONS;
- -
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, TEAM_INDX, END }, { GEOM, TEAM_INDX, INT, END }}, 3 };
- - S32 profile = checkArgList(L, constructorArgList, "CoreItem", "constructor");
- - if(profile == 1)
- - {
- - setPos(getPointOrXY(L, 1));
- - setTeam(getInt(L, 2));
- - }
- - else if(profile == 2)
- - {
- - setPos(getPointOrXY(L, 1));
- - setTeam(getInt(L, 2));
- - setStartingHealth(getInt(L, 3));
- - // I've got no idea why this works and getInt(L, 2) doesn't.
- - //mSpawnTime = S32(getInt(L, 3) * 1000);
- - //mTimer.reset(mSpawnTime);
- - }
- - }
- }
- diff -r da40340a2909 -r 70cdfe0ad762 zap/EngineeredItem.cpp
- --- a/zap/EngineeredItem.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/EngineeredItem.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -1689,20 +1689,10 @@
- // Combined Lua / C++ default constructor
- Turret::Turret(lua_State *L) : Parent(TEAM_NEUTRAL, Point(0,0), Point(1,0))
- {
- - // TODO: This does not work; we need to snap the turret to a nearby wall and compute the normal angle.
- - // It is likely that setPos is similarly broken. And maybe more.
- + initialize();
- +
- if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, TEAM_INDX, END }}, 2 };
- - S32 profile = checkArgList(L, constructorArgList, "Turret", "constructor");
- findMountPoint(Game::getAddTarget(), getPos());
- - if(profile == 1)
- - {
- - findMountPoint(gServerGame, getPointOrXY(L, 1));
- - setTeam(getInt(L, 2));
- - }
- - }
- - initialize();
- }
- @@ -2049,8 +2039,6 @@
- /////
- // Lua interface
- /**
- - * @luafunc Turret::Turret()
- - * @luafunc Turret::Turret(geom, team)
- * @luaclass Turret
- * @brief Mounted gun that shoots at enemy ships and other objects.
- */
- diff -r da40340a2909 -r 70cdfe0ad762 zap/Spawn.cpp
- --- a/zap/Spawn.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/Spawn.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -206,16 +206,7 @@
- // Lua constructor
- Spawn::Spawn(lua_State *L) : AbstractSpawn(Point(0,0))
- {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, TEAM_INDX, END }}, 3 };
- - S32 profile = checkArgList(L, constructorArgList, "Spawn", "constructor");
- initialize();
- - if(L && profile == 1)
- - setPos(getPointOrXY(L, 1));
- - else if(L && profile == 2)
- - {
- - setPos(getPointOrXY(L, 1));
- - setTeam(getInt(L, 2));
- - }
- }
- @@ -298,9 +289,6 @@
- /////
- // Lua interface
- /**
- - * @luafunc Spawn::Spawn()
- - * @luafunc Spawn::Spawn(geom)
- - * @luafunc Spawn::Spawn(geom, team)
- * @luaclass Spawn
- * @brief Marks locations where ships and robots should spawn.
- * @geom The geometry of Spawns is a single point.
- @@ -447,22 +435,6 @@
- AsteroidSpawn::AsteroidSpawn(lua_State *L) : Parent(Point(0,0), DEFAULT_RESPAWN_TIME)
- {
- initialize();
- -
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, INT, END }}, 3 };
- - S32 profile = checkArgList(L, constructorArgList, "AsteroidSpawn", "constructor");
- - initialize();
- - if(profile == 1)
- - setPos(getPointOrXY(L, 1));
- - else if(profile == 2)
- - {
- - setPos(getPointOrXY(L, 1));
- - // I've got no idea why this works and getInt(L, 2) doesn't.
- - mSpawnTime = S32(getInt(L, 3) * 1000);
- - mTimer.reset(mSpawnTime);
- - }
- - }
- }
- @@ -557,9 +529,6 @@
- /////
- // Lua interface
- /**
- - * @luafunc AsteroidSpawn::AsteroidSpawn()
- - * @luafunc AsteroidSpawn::AsteroidSpawn(geom)
- - * @luafunc AsteroidSpawn::AsteroidSpawn(geom, time)
- * @luaclass AsteroidSpawn
- * @brief Spawns \link Asteroid Asteroids \endlink at regular intervals.
- * @geom The geometry of AsteroidSpawns is a single point.
- @@ -593,21 +562,6 @@
- CircleSpawn::CircleSpawn(lua_State *L) : Parent(Point(0,0), DEFAULT_RESPAWN_TIME)
- {
- initialize();
- -
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, INT, END }}, 3 };
- - S32 profile = checkArgList(L, constructorArgList, "CircleSpawn", "constructor");
- - if(profile == 1)
- - setPos(getPointOrXY(L, 1));
- - else if(profile == 2)
- - {
- - setPos(getPointOrXY(L, 1));
- - // I've got no idea why this works and getInt(L, 2) doesn't.
- - mSpawnTime = S32(getInt(L, 3) * 1000);
- - mTimer.reset(mSpawnTime);
- - }
- - }
- }
- @@ -704,9 +658,6 @@
- /////
- // Lua interface
- /**
- - * @luafunc CircleSpawn::CircleSpawn()
- - * @luafunc CircleSpawn::CircleSpawn(geom)
- - * @luafunc CircleSpawn::CircleSpawn(geom, time)
- * @luaclass CircleSpawn
- * @brief Spawns \link Circle Circles \endlink at regular intervals.
- * @geom The geometry of CircleSpawns is a single point.
- diff -r da40340a2909 -r 70cdfe0ad762 zap/UIGame.cpp
- --- a/zap/UIGame.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/UIGame.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -2290,7 +2290,7 @@
- { "addbots", &GameUserInterface::addBotsHandler, { xINT, STR, TEAM, STR }, 4, LEVEL_COMMANDS, 1, 2, {"[count]","[file]","[team name or num]","[args]"}, "Add [count] bots from [file] to [team num], pass [args] to bot" },
- { "kickbot", &GameUserInterface::kickBotHandler, { }, 0, LEVEL_COMMANDS, 1, 1, { }, "Kick most recently added bot" },
- { "kickbots", &GameUserInterface::kickBotsHandler, { }, 0, LEVEL_COMMANDS, 1, 1, { }, "Kick all bots" },
- - {"announce", &GameUserInterface::announceHandler, { STR }, 1, ADMIN_COMMANDS, 0, 1, {"<ANNOUNCEMENT>"}, "The admin announces an important message" },
- + {"announce", &GameUserInterface::announceHandler, { STR }, 1, ADMIN_COMMANDS, 0, 1, {"<ANNOUNCEMENT>"}, "The admin announces an important message" },
- { "kick", &GameUserInterface::kickPlayerHandler, { NAME }, 1, ADMIN_COMMANDS, 0, 1, {"<name>"}, "Kick a player from the game" },
- { "ban", &GameUserInterface::banPlayerHandler, { NAME, xINT }, 2, ADMIN_COMMANDS, 0, 1, {"<name>","[duration]"}, "Ban a player from the server (IP-based, def. = 60 mins)" },
- diff -r da40340a2909 -r 70cdfe0ad762 zap/Zone.cpp
- --- a/zap/Zone.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/Zone.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -26,7 +26,6 @@
- #include "Zone.h"
- #include "game.h"
- #include "stringUtils.h"
- -#include "Geometry.h"
- namespace Zap
- {
- @@ -37,17 +36,6 @@
- // Combined Lua / C++ constructor)
- Zone::Zone(lua_State *L)
- {
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }}, 2 };
- - S32 profile = checkArgList(L, constructorArgList, "Zone", "constructor");
- -
- - if(profile == 1)
- - {
- - setGeom(L, 1);
- - }
- - }
- -
- setTeam(TEAM_NEUTRAL);
- mObjectTypeNumber = ZoneTypeNumber;
- @@ -160,9 +148,7 @@
- /////
- // Lua interface
- -/**
- - * @luafunc Zone::Zone()
- - * @luafunc Zone::Zone(geom)
- +/**
- * @luaclass Zone
- * @brief Invisible objects, used mainly for generating events.
- */
- diff -r da40340a2909 -r 70cdfe0ad762 zap/barrier.cpp
- --- a/zap/barrier.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/barrier.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -31,7 +31,6 @@
- #include "game.h"
- #include "config.h"
- #include "stringUtils.h"
- -#include "LuaWrapper.h"
- #ifndef ZAP_DEDICATED
- # include "OpenglUtils.h"
- @@ -350,18 +349,6 @@
- mAlreadyAdded = false;
- setNewGeometry(geomPolyLine);
- -
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, INT, END }}, 2 };
- - S32 profile = checkArgList(L, constructorArgList, "WallItem", "constructor");
- - if(profile == 1)
- - {
- - setWidth(lua_tointeger(L, -1));
- - lua_pop(L, 1);
- - setGeom(L);
- - }
- - }
- LUAW_CONSTRUCTOR_INITIALIZATIONS;
- }
- @@ -584,8 +571,6 @@
- /////
- // Lua interface
- /**
- - * @luafunc WallItem::WallItem()
- - * @luafunc WallItem::WallItem(geom, thickness)
- * @luaclass WallItem
- * @brief Traditional wall item.
- * @descr A %WallItem is a traditional wall consisting of a series of straight-line segments. WallItems have a width setting that
- diff -r da40340a2909 -r 70cdfe0ad762 zap/flagItem.cpp
- --- a/zap/flagItem.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/flagItem.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -45,21 +45,6 @@
- FlagItem::FlagItem(lua_State *L) : Parent(Point(0,0), true, (F32)Ship::CollisionRadius) // radius was 20
- {
- initialize();
- -
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, TEAM_INDX, END }}, 3 };
- - S32 profile = checkArgList(L, constructorArgList, "FlagItem", "constructor");
- - if(profile == 1)
- - {
- - setPos(getPointOrXY(L, 1));
- - }
- - else if(profile == 2)
- - {
- - setPos(getPointOrXY(L, 1));
- - setTeam(getInt(L, 2));
- - }
- - }
- }
- @@ -411,9 +396,6 @@
- // Lua interface
- /**
- - * @luafunc FlagItem::FlagItem()
- - * @luafunc FlagItem::FlagItem(geom)
- - * @luafunc FlagItem::FlagItem(geom, team)
- * @luaclass FlagItem
- * @brief Flags are used in many games, such as Nexus and Capture The Flag (CTF).
- * @geom The geometry of a %FlagItem is a point.
- diff -r da40340a2909 -r 70cdfe0ad762 zap/moveObject.cpp
- --- a/zap/moveObject.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/moveObject.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -1310,16 +1310,6 @@
- mDesign = TNL::Random::readI(0, ASTEROID_DESIGNS - 1);
- mKillString = "crashed into an asteroid";
- -
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }}, 2 };
- - S32 profile = checkArgList(L, constructorArgList, "Asteroid", "constructor");
- - if(profile == 1)
- - {
- - setPos(getPointOrXY(L, 1));
- - }
- - }
- LUAW_CONSTRUCTOR_INITIALIZATIONS;
- }
- @@ -1611,8 +1601,6 @@
- // Lua interface
- /**
- - * @luafunc Asteroid::Asteroid()
- - * @luafunc Asteroid::Asteroid(geom)
- * @luaclass Asteroid
- * @brief Just like the arcade game! Yo!
- */
- diff -r da40340a2909 -r 70cdfe0ad762 zap/projectile.cpp
- --- a/zap/projectile.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/projectile.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -1017,20 +1017,7 @@
- // Combined Lua / C++ default constructor -- used in Lua and editor
- SpyBug::SpyBug(lua_State *L) : Burst(Point(0,0), Point(0,0), NULL)
- {
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, TEAM_INDX, END }}, 2 };
- - S32 profile = checkArgList(L, constructorArgList, "SpyBug", "constructor");
- -
- - if(profile == 0)
- - initialize(Point(0,0), NULL);
- - else if(profile == 1)
- - {
- - initialize(Point(0,0), NULL);
- - setPos(getPointOrXY(L, 1));
- - setTeam(getInt(L, 2));
- - }
- - }
- + initialize(Point(0,0), NULL);
- }
- @@ -1253,14 +1240,6 @@
- /////
- // Lua interface
- -/**
- - * @luafunc SpyBug::SpyBug()
- - * @luafunc SpyBug::SpyBug(geom, team)
- - * @luaclass SpyBug
- - * @brief Monitors a section of the map and will show enemy ships there.
- - * @descr Can only be used/created if the Sensor module is selected.
- - * Makes surrounding areas of the commander's map visible to player and teammates.
- - */
- // Fn name Param profiles Profile count
- #define LUA_METHODS(CLASS, METHOD) \
- diff -r da40340a2909 -r 70cdfe0ad762 zap/speedZone.cpp
- --- a/zap/speedZone.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/speedZone.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -63,9 +63,6 @@
- // Combined C++/Lua constructor
- SpeedZone::SpeedZone(lua_State *L)
- {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }, { GEOM, NUM, END }}, 3 };
- - S32 profile = checkArgList(L, constructorArgList, "SpeedZone", "constructor");
- -
- mNetFlags.set(Ghostable);
- mObjectTypeNumber = SpeedZoneTypeNumber;
- @@ -75,14 +72,6 @@
- mUnpackInit = 0; // Some form of counter, to know that it is a rotating speed zone
- preparePoints(); // If this is constructed by Lua, we need to have some default geometry in place
- -
- - if(L && profile == 1)
- - setPos(getPointOrXY(L, 1));
- - else if(L && profile == 2)
- - {
- - setPos(getPointOrXY(L, 1));
- - setSpeed(getInt(L, 2));
- - }
- LUAW_CONSTRUCTOR_INITIALIZATIONS;
- }
- @@ -541,9 +530,6 @@
- //// Lua methods
- /**
- - * @luafunc SpeedZone::SpeedZone()
- - * @luafunc SpeedZone::SpeedZone(geom)
- - * @luafunc SpeedZone::SpeedZone(geom, speed)
- * @luaclass SpeedZone
- * @brief Propels ships at high speed.
- * @descr SpeedZones are game objects that propel ships around a level. Each %SpeedZone has a direction point
- diff -r da40340a2909 -r 70cdfe0ad762 zap/teleporter.cpp
- --- a/zap/teleporter.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/teleporter.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -86,11 +86,13 @@
- {
- TNLAssert(mOwner, "We need an owner here!");
- mDests.push_back(dest);
- +
- if(mDests.size() == 1) // Just added the first dest
- {
- mOwner->setVert(dest, 1);
- mOwner->updateExtentInDatabase();
- }
- +
- // If we're the server, update the clients
- if(mOwner->getGame() && mOwner->getGame()->isServer())
- mOwner->s2cAddDestination(dest);
- @@ -175,16 +177,7 @@
- // Combined default C++/Lua constructor
- Teleporter::Teleporter(lua_State *L)
- {
- - initialize(Point(0,0),Point(0,0),NULL);
- - // TODO: Fix this one too -- intiailze needs to be refactored because who knows
- - // how many points the teleporter is getting? could be 1, could be 2, could be many
- - if(L)
- - {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, END }}, 2 };
- - S32 profile = checkArgList(L, constructorArgList, "Teleporter", "constructor");
- - if(profile == 1)
- - setPos(getPointOrXY(L, 1));
- - }
- + initialize(Point(0,0), Point(0,0), NULL);
- }
- @@ -865,8 +858,6 @@
- //// Lua methods
- /**
- - * @luafunc Teleporter::Teleporter()
- - * @luafunc Teleporter::Teleporter(geom)
- * @luaclass Teleporter
- * @brief Instantly transports ships from here to there.
- * @descr A %Teleporter represents the basic teleporter object. Every teleporter has an intake location
- diff -r da40340a2909 -r 70cdfe0ad762 zap/textItem.cpp
- --- a/zap/textItem.cpp Sun Jan 13 12:05:03 2013 +0100
- +++ b/zap/textItem.cpp Sun Jan 13 11:57:17 2013 +0100
- @@ -53,9 +53,6 @@
- // Combined Lua / C++ constructor
- TextItem::TextItem(lua_State *L)
- {
- - static LuaFunctionArgList constructorArgList = { {{ END }, { GEOM, STR, END }}, 2 };
- - S32 profile = checkArgList(L, constructorArgList, "Spawn", "constructor");
- -
- mNetFlags.set(Ghostable);
- mObjectTypeNumber = TextItemTypeNumber;
- @@ -63,12 +60,6 @@
- mSize = 20;
- LUAW_CONSTRUCTOR_INITIALIZATIONS;
- -
- - if(L && profile == 1)
- - {
- - setPos(getPointOrXY(L, 1));
- - setText(getString(L, 2));
- - }
- }
- @@ -435,8 +426,6 @@
- //// Lua methods
- /**
- - * @luafunc TextItem::TextItem()
- - * @luafunc TextItem::TextItem(geom, text)
- * @luaclass TextItem
- * @brief Display text message in level.
- * @descr A %TextItem displays text in a level. If the %TextItem belongs to a team, it is only visible to players on that team.
Advertisement
Add Comment
Please, Sign In to add comment