]> git.pond.sub.org Git - empserver/commitdiff
(could_be_on_ship): Not consistent with fit_plane_on_ship(). Fix by
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 1 Nov 2007 06:35:50 +0000 (06:35 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 1 Nov 2007 06:35:50 +0000 (06:35 +0000)
using that.  Less efficient, but that doesn't really matter here.

src/lib/subs/plnsub.c

index 1b74bd9d1be0a0d3a4ec5676fbbfa2f709fd1178..83e1ef7c74f7779df28479f318e8cb210217ed2d 100644 (file)
@@ -952,31 +952,16 @@ take_plane_off_land(struct plnstr *plane, struct lndstr *land)
 }
 
 /*
- * Could a plane of PP's type be on on a ship of SP's type?
+ * Could a plane of PP's type be on on ship SP?
  */
 int
 could_be_on_ship(struct plnstr *pp, struct shpstr *sp)
 {
-    struct plchrstr *pcp = plchr + pp->pln_type;
-    struct mchrstr *mcp = mchr + sp->shp_type;
-
-    if (pcp->pl_flags & P_L)
-       if (mcp->m_flags & M_FLY)
-           return 1;
-
-    if (pcp->pl_flags & P_K)
-       if (mcp->m_flags & M_CHOPPER)
-           return 1;
-
-    if (pcp->pl_flags & P_M)
-       if (mcp->m_flags & M_MSL)
-           return 1;
-
-    if (pcp->pl_flags & P_E)
-       if (mcp->m_flags & M_XLIGHT)
-           return 1;
+    struct shpstr ship;
 
-    return 0;
+    ship = *sp;
+    sp->shp_nplane = sp->shp_nchoppers = sp->shp_nxlight = 0;
+    return fit_plane_on_ship(pp, &ship);
 }
 
 void