Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rt committed Mar 3, 2013
1 parent 99d555c commit c642f0d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions rts/Lua/LuaSyncedCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3549,17 +3549,15 @@ int LuaSyncedCtrl::SetTerrainTypeData(lua_State* L)

int LuaSyncedCtrl::SpawnProjectile(lua_State* L)
{
const WeaponDef* weaponDef = weaponDefHandler->GetWeaponDefByID(luaL_checkint(L, 1));
ProjectileParams params;

if (weaponDef == NULL) {
if ((params.weaponDef = weaponDefHandler->GetWeaponDefByID(luaL_checkint(L, 1))) == NULL) {
lua_pushboolean(L, false);
return 0;
} else {
ParseProjectileParams(L, params, 2, __FUNCTION__);
lua_pushboolean(L, WeaponProjectileFactory::LoadProjectile(params));
}

ProjectileParams params;
ParseProjectileParams(L, params, 2, __FUNCTION__);

lua_pushboolean(L, WeaponProjectileFactory::LoadProjectile(params));
return 1;
}

Expand Down

0 comments on commit c642f0d

Please sign in to comment.