Don't drill (and deplete) more oil than the ship can hold.
Closes #955071.
This commit is contained in:
parent
8ce25abc1f
commit
743be658c8
1 changed files with 2 additions and 2 deletions
|
@ -170,10 +170,10 @@ upd_ship(register struct shpstr *sp, register int etus,
|
|||
*/
|
||||
oil_gained = roundavg((sp->shp_item[I_CIVIL] * etus / 10000.0)
|
||||
* sectp->sct_oil);
|
||||
sp->shp_item[I_OIL] += oil_gained;
|
||||
max_oil = vl_find(V_OIL, mp->m_vtype, mp->m_vamt, mp->m_nv);
|
||||
if (sp->shp_item[I_OIL] > max_oil)
|
||||
sp->shp_item[I_OIL] = max_oil;
|
||||
oil_gained = max_oil - sp->shp_item[I_OIL];
|
||||
sp->shp_item[I_OIL] += oil_gained;
|
||||
product = &pchr[P_OIL];
|
||||
if (product->p_nrdep != 0 && oil_gained > 0) {
|
||||
resource = ((s_char *)sectp) + product->p_nrndx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue