/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* cargo.c: Cargo lists
- *
+ *
* Known contributors to this file:
* Markus Armbruster, 2008
*/
{
if (CANT_HAPPEN(type < 0 || type > EF_NUKE))
return;
- if (old >= 0)
+ if (old >= 0 && !CANT_HAPPEN(old >= nclink[type]))
clink_rem(&clink[type][old], cargo->ef_type, cargo->uid);
- if (new >= 0)
+ if (new >= 0 && !CANT_HAPPEN(new >= nclink[type]))
clink_add(&clink[type][new], cargo->ef_type, cargo->uid);
}