]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/trad.c
Update copyright notice
[empserver] / src / lib / commands / trad.c
index c3f7c09d10fc662d8e51b27d4d40e37aaaf545a2..2e24a29b82d69c67b5c1f5587fef278af7065eae 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2017, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -95,7 +95,7 @@ trad(void)
            continue;
        if (!trade_getitem(&trade, &tg)) {
            continue;
-       };
+       }
        pr(" %3d ", ni.cur);
        (void)time(&now);
        tleft = trade.trd_markettime + TRADE_DELAY - now;
@@ -182,11 +182,10 @@ trad(void)
        || (trade.trd_type == EF_NUKE)) {
        while (1) {
            p = getstring("Destination sector: ", buf);
-           if (!trade_check_ok(&trade, &tg.gen))
+           if (!p)
                return RET_FAIL;
-           if (!p) {
+           if (!trade_check_ok(&trade, &tg.gen))
                return RET_FAIL;
-           }
            if (!sarg_xy(p, &sx, &sy) || !getsect(sx, sy, &sect)) {
                pr("Bad sector designation; try again!\n");
                continue;
@@ -210,11 +209,10 @@ trad(void)
     } else if (trade.trd_type == EF_LAND) {
        while (1) {
            p = getstring("Destination sector: ", buf);
-           if (!trade_check_ok(&trade, &tg.gen))
+           if (!p)
                return RET_FAIL;
-           if (!p) {
+           if (!trade_check_ok(&trade, &tg.gen))
                return RET_FAIL;
-           }
            if (!sarg_xy(p, &sx, &sy) || !getsect(sx, sy, &sect)) {
                pr("Bad sector designation; try again!\n");
                continue;
@@ -423,7 +421,7 @@ ontradingblock(int type, void *ptr)
 }
 
 void
-trdswitchown(int type, void *ptr, int newown)
+trdswitchown(int type, struct empobj *obj, int newown)
 {
     struct trdstr trade;
     union empobj_storage tg;
@@ -436,7 +434,7 @@ trdswitchown(int type, void *ptr, int newown)
            continue;
        if (trade.trd_type != type)
            continue;
-       if (tg.gen.uid != ((struct empobj *)ptr)->uid)
+       if (tg.gen.uid != obj->uid)
            continue;
        if (trade.trd_owner == trade.trd_maxbidder)
            trade.trd_maxbidder = newown;