]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/actofgod.c
edit: Teleport planes and land units to carrier on load
[empserver] / src / lib / subs / actofgod.c
index 5e1c7372121b8998c840b60143e21159f7d9cdd4..7146577169b48f361bbb1a6376daca187806b8d2 100644 (file)
@@ -157,7 +157,16 @@ divine_load_unload(struct empobj *unit, int type, int uid, char *act)
 void
 divine_load(struct empobj *unit, int type, int uid)
 {
+    union empobj_storage carrier;
+
     divine_load_unload(unit, type, uid, "loaded onto");
+    if (get_empobj(type, uid, &carrier)
+       && (unit->x != carrier.gen.x || unit->y != carrier.gen.y)) {
+       pr("%s teleported from %s to %s!",
+          unit_nameof(unit), xyas(unit->x, unit->y, player->cnum),
+          xyas(carrier.gen.x, carrier.gen.y, player->cnum));
+       unit_teleport(unit, carrier.gen.x, carrier.gen.y);
+    }
 }
 
 void