Hello members!
I'm currently trying to add a new ammo type (namely fuel for the Flamethrower) into my Wolf4SDL mod. I'm now defining the fuel into GiveWeapon. I was trying to compile it with Code::Blocks, but it displays an error in the log saying:
It appears there is some "{" or "}" missing in my code, but I'm not sure where.
This is my WL_AGENT definition:
I'm currently trying to add a new ammo type (namely fuel for the Flamethrower) into my Wolf4SDL mod. I'm now defining the fuel into GiveWeapon. I was trying to compile it with Code::Blocks, but it displays an error in the log saying:
- Code:
-------------- Build: default in Wolf4SDL (compiler: GNU GCC Compiler)---------------
gcc.exe -Dmain=SDL_main -IC:\Dev-Cpp\include\SDL -IC:\Dev-Cpp\include\SDL_mixer -I"C:\Program Files (x86)\CodeBlocks\MinGW\include\SDL" -c D:\Abandonware\Games\Wolfenstein\Project\Code\Wolf4SDL-master\wl_agent.c -o obj\wl_agent.o
D:\Abandonware\Games\Wolfenstein\Project\Code\Wolf4SDL-master\wl_agent.c: In function 'GiveWeapon':
D:\Abandonware\Games\Wolfenstein\Project\Code\Wolf4SDL-master\wl_agent.c:1096:14: error: invalid storage class for function 'FixedByFracOrig'
static fixed FixedByFracOrig(fixed a, fixed b)
^
D:\Abandonware\Games\Wolfenstein\Project\Code\Wolf4SDL-master\wl_agent.c:1642:1: error: expected declaration or statement at end of input
}
^
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
It appears there is some "{" or "}" missing in my code, but I'm not sure where.
This is my WL_AGENT definition:
- Code:
/*
==================
=
= GiveWeapon
=
==================
*/
void GiveWeapon (int weapon)
{
{
if (weapon == wp_machinegun)
{
GiveAmmo (6);
if (gamestate.weapon != weapon /*machine gun*/)
{
gamestate.weapon = gamestate.chosenweapon = (weapontype) weapon;
if (!gamestate.ammo) {
gamestate.ammo = 1 ;
gamestate.ammo++ ;
}
}
return;
}
else if (weapon == wp_chaingun)
{
GiveAmmo (6);
if (gamestate.weapon != weapon /*gatling */)
{
gamestate.weapon = gamestate.chosenweapon = (weapontype) weapon;
if (!gamestate.ammo) {
gamestate.ammo = 1 ;
gamestate.ammo++ ;
}
}
return;
}
else if (weapon == wp_flame)
{
GiveFuel (6);
if (gamestate.weapon != weapon /* flamethrower */)
{
gamestate.weapon = gamestate.chosenweapon = (weapontype) weapon;
if (!gamestate.ammo) {
gamestate.fuel = 1 ;
gamestate.ammo++ ;
}
}
return;
}
if (gamestate.bestweapon<weapon)
gamestate.bestweapon = gamestate.weapon
= gamestate.chosenweapon = (weapontype) weapon;
DrawWeapon ();
}