- if (type == EF_SHIP) {
- ship = (struct shpstr *)ptr;
- there = ship->shp_item[ip->i_vtype];
- mp = &mchr[(int)ship->shp_type];
- max = vl_find(ip->i_vtype, mp->m_vtype,
- mp->m_vamt, (int)mp->m_nv);
- } else {
- there = ((struct sctstr *)ptr)->sct_item[ip->i_vtype];
- max = 32767;
- }
- there += amt;
- if (there > max) {
- pr("%d excess %s discarded\n", max - there, ip->i_name);
- amt = max - there;
- there = max;
- }
- pr("%d %s landed safely", amt, ip->i_name);
- if (type == EF_SECTOR) {
- struct sctstr *sectp = (struct sctstr *)ptr;
- sectp->sct_item[ip->i_vtype] = there;
- if (sectp->sct_own != player->cnum)
- wu(0, sectp->sct_own, "%s planes drop %d %s in %s\n",
- cname(player->cnum), amt, ip->i_name,
- xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
- pr(" at %s\n", xyas(tx, ty, player->cnum));
- putsect((struct sctstr *)ptr);
- } else {
- struct shpstr *sp = (struct shpstr *)ptr;
- sp->shp_item[ip->i_vtype] = there;
- if (sp->shp_own != player->cnum)
- wu(0, sp->shp_own, "%s planes land %d %s on carrier %d\n",
- cname(player->cnum), amt, ip->i_name, sp->shp_uid);
- pr(" on carrier #%d\n", ship->shp_uid);
- putship(ship->shp_uid, ship);
- }
+ struct shpstr *sp = (struct shpstr *)ptr;
+ sp->shp_item[ip->i_vtype] = there;
+ if (sp->shp_own != player->cnum)
+ wu(0, sp->shp_own, "%s planes land %d %s on carrier %d\n",
+ cname(player->cnum), amt, ip->i_name, sp->shp_uid);
+ pr(" on carrier #%d\n", sp->shp_uid);
+ putship(sp->shp_uid, sp);