[Fix] Bug concerning not being able to shoot seeker weapons.
This commit is contained in:
parent
31146a0874
commit
de91ebd91f
@ -455,8 +455,8 @@
|
||||
<chance>40</chance>
|
||||
<energy>10</energy>
|
||||
</specific>
|
||||
</outfit>
|
||||
<outfit name="Mace Launcher">
|
||||
</outfit>
|
||||
<outfit name="Mace Launcher">
|
||||
<general>
|
||||
<max>2</max>
|
||||
<tech>3</tech>
|
||||
@ -476,7 +476,7 @@
|
||||
<tech>2</tech>
|
||||
<mass>2</mass>
|
||||
<price>700</price>
|
||||
<description>The Mace rocket is a very heavy fast accelerating rocket designed for high speed collisions. The rockets doesn't have too much explosive, instead it has a lot of fuel for the acceleration it uses to combust. Most of the damage it does is from the impact and not the explosion though.</description>
|
||||
<description>The Mace rocket is a very heavy fast accelerating rocket designed for high speed collisions. The rockets doesn't have too much explosive, instead it has a lot of fuel for the acceleration it uses to combust. Most of the damage it does is from the impact and not the explosion though.</description>
|
||||
<gfx_store>mace</gfx_store>
|
||||
</general>
|
||||
<specific type="missile dumb ammo">
|
||||
|
12
dat/ship.xml
12
dat/ship.xml
@ -315,7 +315,7 @@
|
||||
<price>11500000</price>
|
||||
<fabricator>House Goddard</fabricator>
|
||||
<tech>9999</tech>
|
||||
<description>A Dvaered Goddard.</description>
|
||||
<description>A Draktharr Goddard.</description>
|
||||
<movement>
|
||||
<thrust>100</thrust>
|
||||
<turn>80</turn>
|
||||
@ -453,9 +453,9 @@
|
||||
<sound>engine</sound>
|
||||
<class>1</class>
|
||||
<price>400000</price>
|
||||
<fabricator>House Dvaered</fabricator>
|
||||
<fabricator>House Draktharr</fabricator>
|
||||
<tech>8</tech>
|
||||
<description>The Vendetta displays the House Dvaered philosophy very well. Give a ship as many intimidating guns as you can, layer it with as much armour and you can, and sort of forget about giving it proper electronics. It's amazing to see that these fly.</description>
|
||||
<description>The Vendetta displays the House Draktharr philosophy very well. Give a ship as many intimidating guns as you can, layer it with as much armour and you can, and sort of forget about giving it proper electronics. It's amazing to see that these fly.</description>
|
||||
<movement>
|
||||
<thrust>200</thrust>
|
||||
<turn>125</turn>
|
||||
@ -510,9 +510,9 @@
|
||||
<cap_cargo>5</cap_cargo>
|
||||
</characteristics>
|
||||
<outfits>
|
||||
<outfit quantity="6">Laser Cannon</outfit>
|
||||
<outfit quantity="1">Mace Launcher</outfit>
|
||||
<outfit quantity="5">Mace Rocket</outfit>
|
||||
<outfit quantity="6">Laser Cannon</outfit>
|
||||
<outfit quantity="1">Mace Launcher</outfit>
|
||||
<outfit quantity="5">Mace Rocket</outfit>
|
||||
</outfits>
|
||||
</ship>
|
||||
<ship name="Pirate Vendetta">
|
||||
|
2
src/ai.c
2
src/ai.c
@ -944,6 +944,8 @@ static int ai_secondary(lua_State* L) {
|
||||
char* type;
|
||||
const char* otype;
|
||||
|
||||
po = NULL;
|
||||
|
||||
/* Search for a type. */
|
||||
type = NULL;
|
||||
if(lua_isstring(L, 1))
|
||||
|
29
src/pilot.c
29
src/pilot.c
@ -248,19 +248,26 @@ static void pilot_shootWeapon(Pilot* p, PilotOutfit* w, const unsigned int t) {
|
||||
}
|
||||
}
|
||||
/* Missile launchers. */
|
||||
/* Must be secondary weapon, Shooter can't be the target. */
|
||||
else if(outfit_isLauncher(w->outfit) && (w == p->secondary) && (p->id != t)) {
|
||||
if(p->ammo && (p->ammo->quantity > 0)) {
|
||||
/* Enough energy? */
|
||||
if(outfit_energy(w->outfit) > p->energy) return;
|
||||
/* Must be secondary weapon. */
|
||||
else if(outfit_isLauncher(w->outfit) && (w == p->secondary)) {
|
||||
/* Shooter can't be the target - Sanity check for the player. */
|
||||
if((w->outfit->type != OUTFIT_TYPE_MISSILE_DUMB) && (p->id == t))
|
||||
return;
|
||||
|
||||
p->energy -= outfit_energy(w->outfit);
|
||||
weapon_add(p->ammo->outfit, p->solid->dir, &p->solid->pos,
|
||||
&p->solid->vel, p->id, t);
|
||||
/* Must have ammo left. */
|
||||
if(p->ammo && (p->ammo->quantity <= 0))
|
||||
return;
|
||||
|
||||
w->timer = SDL_GetTicks(); /* Can't shoot for a while. */
|
||||
p->ammo->quantity -= 1; /* There's no getting this one back. */
|
||||
}
|
||||
/* Enough energy? */
|
||||
if(outfit_energy(w->outfit) > p->energy)
|
||||
return;
|
||||
|
||||
p->energy -= outfit_energy(w->outfit);
|
||||
weapon_add(p->ammo->outfit, p->solid->dir, &p->solid->pos,
|
||||
&p->solid->vel, p->id, t);
|
||||
|
||||
w->timer = SDL_GetTicks(); /* Can't shoot for a while. */
|
||||
p->ammo->quantity -= 1; /* There's no getting this one back. */
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user