Commit graph

  • 7a59ab4784 Spelling fix. Closes #913151. Markus Armbruster 2004-03-10 07:24:56 +00:00
  • 361dc5d209 Spelling fix. Closes #912922. Markus Armbruster 2004-03-10 07:20:56 +00:00
  • 9d30b2d0f6 (scra): Work directly on item arrays instead of copies made by getvec(). This is safe, because the old code made single copies and always flushed them back into the unit structures before flushing those. To do: obey ITEM_MAX. Markus Armbruster 2004-03-09 19:32:43 +00:00
  • ab482ecd39 (grin): Stop grinding before grind puts more than ITEM_MAX bar constituents in sector. Work directly on item arrays instead of copies made by getvec(). This is safe, because the old code made single copies and always flushed them back into the unit structures before flushing those. Markus Armbruster 2004-03-09 19:31:30 +00:00
  • 2a3b29ebe1 (improve, shoo, spy, buildeff): Work directly on item arrays instead of copies made by getvec(). This is safe, because the old code made single copies and always flushed them back into the unit structures before flushing those. Markus Armbruster 2004-03-09 19:26:02 +00:00
  • 4ad649950e (buil): Work directly on item arrays instead of copies made by getvec(). This is safe, because the old code made single copies and always flushed them back into the unit structures before flushing those. (build_ship, build_land, build_bridge, build_nuke, build_plane, build_tower): Change parameter type to match uncopied item arrays. Markus Armbruster 2004-03-09 14:52:21 +00:00
  • 67ad7ad66a New option -f. Markus Armbruster 2004-03-09 14:38:59 +00:00
  • e3eadcd899 Utility programs land', ore' and `perfect' haven't been built by default for ages (at least 4.2.0 '98). Unsurprisingly, they don't compile anymore. Remove them. Markus Armbruster 2004-03-09 14:22:57 +00:00
  • be626bacb1 (lwpCreate): Avoid harmless compiler warning. Markus Armbruster 2004-03-09 13:28:16 +00:00
  • 510a57f4ea The fix in the previous rev. wasn't complete. Markus Armbruster 2004-03-09 13:20:39 +00:00
  • f187082daa (mobupdate): Fix argument of time(). Markus Armbruster 2004-03-09 12:33:17 +00:00
  • e7d75b2279 Use gcc function attribute `format' to catch bad format strings. Fix them. From Marc Olzheim. Type modifier 'l' was missing in many places, probably rendering the server useless on 64-bit hosts. (ef_flush, ef_write, ef_extend, lwpCreate, lwpDestroy): Use conversion specifier 'p' to print pointers. (check_market): Fix display of loan amount. (doland): Fix unescaped '%' (undefined behavior). (ldump, ndump, pdump, sdump): Don't use flag '0' with conversion specifier 's' (undefined behavior). (dump, ldump, lost, ndump, pdump, sdump, empth_create, update_sched): Cast time_t and pthread_t to long for printing. (lwpStackCheck, lwpStackCheckUsed, finish_sects): Insert cast to fix argument type on all platforms. (prod): Remove extra argument. (perform_mission, airdamage, retreat_land1, lwpReschedule): Format string missed arguments. Markus Armbruster 2004-03-09 12:27:40 +00:00
  • 735adbf41b Use short' instead of unsigned short' for item storage in places that were missed in the original changeset. Markus Armbruster 2004-03-06 07:16:45 +00:00
  • f427b30f74 From Ron Koenderink: (pr_land): Fix display of attack and defense value. (dounit): New parameter farg. Callers changed. Use it to implement attack and defense value editing. Closes #872271. (pr_ship): More space efficient display. (pr_ship): Display defense value. (doship): Implement defense value editing. Markus Armbruster 2004-03-05 19:58:07 +00:00
  • ed4ffe9482 (resupply_commod, s_commod, use_supply, has_supply): Work directly on item arrays instead of copies made by getvec(). This is safe, because the old code made single copies and always flushed them back into the unit structures before flushing those. Markus Armbruster 2004-03-05 19:36:24 +00:00
  • ce40449533 (use_supply): Fix the trickery designed to avoid resupply from itself. Currently, use_supply() is only called for artillery, where the trickery is not needed, so this fix isn't observable. Not sure whether it would be needed if use_supply() were called for supply units. Markus Armbruster 2004-03-05 19:28:05 +00:00
  • ed7293f856 (has_supply): Fix the trickery designed to avoid resupply from itself. Not sure the trickery is needed. Also avoid `might be used uninitialized' warning. Markus Armbruster 2004-03-05 18:31:22 +00:00
  • 4ee7608b0e (s_commod): When !ACTUALLY_DOIT, recursive land unit resupply didn't work, because the effect of the resupply was immediately undone by an untimely getvec(). Markus Armbruster 2004-03-05 17:10:25 +00:00
  • 7969ff8047 (s_commod): Don't zap supply unit fuel on recursive resupply. No idea why it was coded that way; it doesn't make sense. No supply units using fuel exist in the stock game. Markus Armbruster 2004-03-05 16:36:55 +00:00
  • d35085e5c4 (s_commod): Clarify and comment the trickery required to make the recursion work. By the way, resuppling from supply units in unit id order is a greedy algorithm, which is quite inappropriate for the problem. Markus Armbruster 2004-03-05 16:30:30 +00:00
  • e6ffdb71ee (gen_power, addtopow): Call addtopow() directly on item arrays instead of copies made by getvec(). This is obviously correct, since there are no writes. Markus Armbruster 2004-03-05 13:20:11 +00:00
  • 733aff63ed (att_move_in_off): Don't put more than ITEM_MAX food into the assaulted sector. Simplify some more. Markus Armbruster 2004-03-05 13:14:28 +00:00
  • ebb472ed58 (att_move_in_off): The lunchbox code was unnecessary general, therefore had unreachable code. Which was also buggy. Simplify. Markus Armbruster 2004-03-05 13:04:12 +00:00
  • 7d7945c3e9 Replace getvec() by direct, read-only item access in some cases where that's obviously correct. Markus Armbruster 2004-03-05 12:05:33 +00:00
  • 4f6e806975 [START_UNITS] (deity_build_land): Replace variable access in disabled code missed in the previous revision. Markus Armbruster 2004-03-05 11:55:13 +00:00
  • b1461faea5 Replace getvec() by direct, read-only item access in some cases where that's obviously correct. Markus Armbruster 2004-03-05 10:38:58 +00:00
  • 99bfa19a92 (getilist, att_get_combat): Simplify. No functional changes. Markus Armbruster 2004-03-05 08:05:58 +00:00
  • ade0e97856 (putvec): Saturate and log error on underflow/overflow, don't just truncate. Markus Armbruster 2004-03-05 07:59:29 +00:00
  • 9989c5b3ec (sctstr, shpstr, lndstr): Use short' instead of unsigned short' for item storage. Rationale: Permitted values are 0..M, where M depends on the container. The largest M is ITEM_MAX (9999). Benign overflow/underflow occurs at those limits. Catastrophic overflow/underflow occurs at the limits of the underlying data type. For unsigned short', any underflow is catastrophic. For short', benign undeflow happens long before catastrophic underflow. Moreover, unsigned arithmetic tends to trip up unwary programmers. Markus Armbruster 2004-03-05 07:56:50 +00:00
  • 58e93c0ea3 (deli, do_demo, lnd_sweep, guerrilla): Saturate items at ITEM_MAX. With variables, item increases beyond the capacity of variables (65535) were ignored here. Markus Armbruster 2004-03-05 06:48:57 +00:00
  • 95ef2b139d (ITEM_MAX): New, value 9999. (give, deliver_it): Use it instead of 9990. (load_comm_ship, load_comm_land, rese): Use it instead of 9999. (thre): Use it instead of 10000. (check_market, explore, move, pln_dropoff): Use it instead of 32767. (unload_it): Use it instead of 99999 (which couldn't possibly work, but what do you expect from the autonav code). Markus Armbruster 2004-03-05 06:34:34 +00:00
  • 5ec624514a (load_comm_ship, load_comm_land): Partial rewrite for clarity. Fix `are we loading' tests. Closes #752493 and #965504. Markus Armbruster 2004-03-04 20:05:01 +00:00
  • abd1fd2c1e (FALLOUT_MAX): New. (doland, detonate, spread_fallout): Use it. With variables, fallout beyond the capacity of variables (65535) was ignored, except in doland(), where it saturated at 9999, and spread_fallout, where it could overflow. Now it always saturates at FALLOUT_MAX. Markus Armbruster 2004-03-04 16:19:50 +00:00
  • 828b84d840 (MINES_MAX): New. (doland, mine, landmine, setsector, pln_dropoff): Use it. With variables, mining beyond the capacity of variables (65535) was ignored. Now the mines saturate at MINES_MAX. Markus Armbruster 2004-03-04 15:54:46 +00:00
  • 7cd66c0f70 (pln_dropoff): Restructure for clarity and to avoid `might be used uninitialized' warning. Markus Armbruster 2004-03-04 15:45:34 +00:00
  • bebca811de (pln_dropoff): The previous revision screwed up output; fix. Markus Armbruster 2004-03-04 15:08:00 +00:00
  • 5bad9875a5 (sctstr): Member sct_che encoded number of che and their target. Simplify. Split into member sct_che (number) and sct_che_target. Users changed. (get_che_cnum, set_che_cnum, get_che_value, get_che_value): Che encoding/decoding functions; remove. (CHE_MAX): Move from var.h to sect.h. (prsect, doland): Print / edit the new field. Markus Armbruster 2004-03-04 13:49:25 +00:00
  • eccc5cb7d7 Sectors need space for items, deliveries and distribution thresholds. To save space, the ancients invented variables': a collection of key-value pairs, missing means zero value, space for enough' keys. This complicates the code, as assigning to a variable' can fail for lack of space. Over time, enough' increased, and for quite some time now `variables' have been *wasting* space. This changeset replaces them, except in struct mchrstr, struct lchrstr and struct pchrstr, where they are read-only, and will be replaced later. It is only a first step; further cleanup is required. To simplify and minimize this necessarily huge changeset, the new item[] arrays have an unused slot 0, and the old variable types V_CIVIL, ... are still defined, but must have the same values as the item types I_CIVIL, ... Markus Armbruster 2004-03-03 16:54:22 +00:00
  • ba86513b01 (plague_people): Log and repair bad plague stage. Markus Armbruster 2004-03-03 13:20:46 +00:00
  • c530a3b980 (genobject, genchrstr): Unused, remove. Markus Armbruster 2004-03-03 10:23:07 +00:00
  • 08e182e132 (fileinit): Invalid cast sct_init(); a call couldn't possibly work. Luckily, it isn't called. Remove. (ef_fileinit): Unused, remove. Markus Armbruster 2004-03-03 10:17:53 +00:00
  • 42290db8c8 (nameofitem, produce, check, fire_dchrg, send_reacting_units_home, do_map_set, upd_land, nav_check_atdest, produce, upd_ship): Remove unused parameters. Callers changed. Markus Armbruster 2004-03-03 09:39:50 +00:00
  • 19acc1cd07 (diss, player_coms): Command `dissolve' has been disabled at least since the days of Chainsaw (early '90s), and the code smells bad. Bury it. Markus Armbruster 2004-03-03 08:20:45 +00:00
  • 3060cabc48 (trade_desc): Ignore non-items when printing load. It used to print the plague as item, which indexed ichr[] out of bounds, which leads to crash or bogus output. Markus Armbruster 2004-03-02 20:59:04 +00:00
  • bb811df758 (genitem, ship, plane, land): Remove unused member sell & equivalents. (genitem_ca, ship_ca, plane_ca, land_ca): Remove selector "sell". (comstr, trdstr): Members trd_price, com_price have no effect. Use them instead of trd_maxprice, com_maxprice and remove the latter. (commodity_ca, trade_ca): Remove selector "maxprice". Markus Armbruster 2004-03-01 17:21:40 +00:00
  • 95b650396a (s_commod): Move initialization of `min' before first use. (itemname): Unused, remove. Markus Armbruster 2004-03-01 14:23:44 +00:00
  • f72281b773 (shp_missile_defense): Move big assignment out of if condition for clarity. Markus Armbruster 2004-03-01 14:21:11 +00:00
  • b8c9d6a029 (carriersatxy): Use &&' instead of somewhat confusing &'. Markus Armbruster 2004-03-01 14:18:37 +00:00
  • 1f5754b5aa (player_new) [!RESOLVE_IPADDRESS]: Don't define unused local variable. Markus Armbruster 2004-03-01 14:17:58 +00:00
  • 69d06bad46 (sctcache, bestp) [!DO_EFF_MEM_CHECKING]: cache isn't used, don't define it. Markus Armbruster 2004-03-01 14:16:31 +00:00
  • 21dd4cfc0f (draw_map): Fix test of player->command->c_flags. Broken code happened to work because C_MOD is the only flag defined. Markus Armbruster 2004-03-01 14:14:39 +00:00
  • bbeab716f4 Remove duplicate macro definitions. Markus Armbruster 2004-03-01 14:10:11 +00:00
  • e1cb606dab Break excessively long line. Markus Armbruster 2004-03-01 14:07:10 +00:00
  • 7d12f4b841 (deity_build_land) [!START_UNITS]: Unused, don't define. Markus Armbruster 2004-03-01 14:06:23 +00:00
  • d0cf6a0a9b Clean up switch cases: proper fall through comments, no break after return. Markus Armbruster 2004-03-01 14:03:29 +00:00
  • 7c52730439 Don't cast void to void. Markus Armbruster 2004-03-01 13:56:07 +00:00
  • 262e1bafba Remove some unused junk. Markus Armbruster 2004-03-01 13:48:45 +00:00
  • 5df329c766 Remove RCS keyword comment, it's a nuisance. Markus Armbruster 2004-03-01 13:41:10 +00:00
  • 5fa00591fe (sccsid): Useless, as we don't use SCCS. Remove. Markus Armbruster 2004-03-01 13:33:51 +00:00
  • 98b392d72c (CHE_MAX): Don't define twice, define once in a header. (get_che_cnum, set_che_cnum, get_che_value, set_che_value): Remove redundant definitions. Markus Armbruster 2004-03-01 13:32:06 +00:00
  • 13797a2ba2 (execute): Fix botched test for empty argument. Markus Armbruster 2004-03-01 13:26:39 +00:00
  • 0c19d70c74 (mult, player_coms): Command `mult' is disabled since 4.0.0 ('96), and its code is obviously not in working order. Remove. (minmult, maxmult, configkeys): Unused configuration parameters, remove. (tradedesc): Remove code related to mult that had no effect. (multread, commread, commwrite, commamt, commset, multset, commprice): Dangerous, because code bypasses ef_read() & friends, remove. (diss): Commodity cleanup uses the above, remove. Command is disabled and unlikely to work anyway. Markus Armbruster 2004-03-01 09:04:02 +00:00
  • 30cb9e2a83 (interix, INTERIXCFLAGS, INTERIXLFLAGS, INTERIXMASTER): New, from Ron Koenderink. Markus Armbruster 2004-03-01 07:10:31 +00:00
  • ef0ddff4c2 (safe_getcwd): New. When getcwd() is known to be able to allocate its buffer, just call that. Else wrap suitable allocation around it. (main): Use it. Markus Armbruster 2004-03-01 07:07:27 +00:00
  • 5ce301e2fb (ntinstall): Fix mkdir data. Markus Armbruster 2004-03-01 06:58:03 +00:00
  • b572ec19ad Fix missing include. Markus Armbruster 2004-02-29 11:41:26 +00:00
  • d500806bc8 inet_ntoa() is available on all machines that matter, and defining it ourselves without adequate auto-configuration creates more problems than it solves. In particular since we defined it with the wrong type. Markus Armbruster 2004-02-29 11:41:08 +00:00
  • f6d7ebb480 (rea): Don't use L_SET, it's ancient BSD history, just use SEEK_SET. Markus Armbruster 2004-02-29 11:35:38 +00:00
  • 37ebd826c4 Fix the previous rev. Markus Armbruster 2004-02-28 19:11:24 +00:00
  • e67dca9d29 Indentation fixes; suspect indent-emp is to blame. Markus Armbruster 2004-02-28 18:06:11 +00:00
  • aa4e268d89 Markup changes: separate items more clearly. Don't use numeric fonts. Markus Armbruster 2004-02-28 17:50:55 +00:00
  • 966d3e7820 \" comments weren't recognized in column 0. Markus Armbruster 2004-02-28 17:32:30 +00:00
  • b0bd4e90ac (commodity_ca): "xloc", "yloc", "xsell", "ysel" and "price" weren't NSC_DEITY. Wrong, but commodity_ca[] is currently unused. Also rename "xloc", "yloc" to "xsell", "ysell". Markus Armbruster 2004-02-28 16:23:56 +00:00
  • 43f7f153a7 (trade_ca): "xloc" and "yloc" weren't NSC_DEITY. Wrong, but trade_ca[] is currently unused. Markus Armbruster 2004-02-28 15:31:21 +00:00
  • 97e221baae Remove some unused stuff, mostly Empire 3 leftovers. Markus Armbruster 2004-02-28 09:45:10 +00:00
  • 3d0178b994 (NSC_OPMASK, NSC_ISNUM1, NSC_ISNUM2, nscstr, nstr_comp, nstr_exec): Simplify encoding of struct ncstr member oper. Markus Armbruster 2004-02-28 08:49:39 +00:00
  • bd54488715 (NSC_ROUND): No effect, remove. Markus Armbruster 2004-02-28 08:40:53 +00:00
  • dd01fcd4c6 (sect_ca, genitem_ca, ship_ca, plane_ca, land_ca, nuke_ca, treaty_ca, loan_ca, news_ca, lost_ca, commodity_ca, trade_ca, nat_ca, map_ca): NSC_OFF was lost during Empire3, rendering the codes confusing and harder to use. Tack it back on. (encode, code_char): No need to fool around with NSC_OFF anymore. Markus Armbruster 2004-02-28 08:29:21 +00:00
  • d31f4f99cf Delete dead code. No functional changes. Should have been committed yesterday's along with nsc.h rev. 1.7. Markus Armbruster 2004-02-28 07:19:31 +00:00
  • dd35a9637d These files were split a long time ago, for technical reasons which since vanished (linking into different programs). Undo the split, because the stuff really belongs together. Markus Armbruster 2004-02-28 06:40:48 +00:00
  • e8b7ed630b (setsector): Fix misleading prompt. Markus Armbruster 2004-02-27 21:55:50 +00:00
  • d2e0c8224b Delete dead code, fix indentation, spelling, obvious warning avoidance, doc fixes. No functional changes. Markus Armbruster 2004-02-27 20:13:28 +00:00
  • f5e49a830c (sct_typematch): New. Use it instead of typematch() where appropriate. (typematch): Prefer exact match to partial match. Use plain char instead of s_char. Markus Armbruster 2004-02-27 19:53:02 +00:00
  • 844b654d44 (stmtch, mineq): Document. Move declaration from prototypes.h to match.h. Use plain char instead of s_char. The code has several thousand type errors due to s_char vs plain char; s_char must go. (stmtch): Rewrite for clarity. Markus Armbruster 2004-02-27 19:38:38 +00:00
  • 520baaf867 (html): Expand tabs in all.html; they can confuse browsers. Markus Armbruster 2004-02-26 09:26:29 +00:00
  • f508dfdcea Document yesterday's changes that closed #803753. Don't re-explain the map in bmap commands. Markus Armbruster 2004-02-26 09:25:08 +00:00
  • 064f0ef1f2 Close #803753: (map_char): New. (draw_map): Use it. Wilderness and plains owned by other players are now displayed as '?'. (radmap2): Display wilderness and plains as '?'. (satmap): Call satdisp() for all sectors owned by other players. Markus Armbruster 2004-02-25 20:18:18 +00:00
  • 57080e76f2 Spelling fix. Closes #901174. Markus Armbruster 2004-02-24 20:54:58 +00:00
  • 34ed6f20af (GCCWARNFLAGS): New. (OSXCFLAGS, FREEBSDCFLAGS, LINUXCFLAGS, LINUXPTHCFLAGS): Use it. Markus Armbruster 2004-02-24 20:35:19 +00:00
  • 2e58c2867a (login_coms): Fix forward declaration (was a definition). Markus Armbruster 2004-02-24 18:35:26 +00:00
  • 4dc46b1810 (fnlist): Move from misc.h to fnlist.h, where it belongs and has complete type. Markus Armbruster 2004-02-24 18:34:25 +00:00
  • aafc693026 Remove junk at end of #endif. Markus Armbruster 2004-02-24 18:26:34 +00:00
  • c53438e7a0 (ef_ensure_space): New. (edit): Use it to to fix copying to virgin unit slot. Closes #896475. From Ron Koenderink. Markus Armbruster 2004-02-24 18:19:57 +00:00
  • 5233f7029f (main, intr, handleintr, termio): Do the right thing for Windows so ^C aborts to the current command, as it should. From Ron Koenderink. Markus Armbruster 2004-02-22 07:27:08 +00:00
  • fdd7679fea (parse): Trailing whitespace was interpreted as an another (empty) argument. Ignore it. Markus Armbruster 2004-02-21 10:18:18 +00:00
  • f221adc42c Fix the previous rev. so it compiles with strict compilers. Markus Armbruster 2004-02-21 06:58:25 +00:00
  • c1be5d8657 Don't declare things in more than one place. Move some declarations between headers. Code is now fully prototyped and compiles cleanly with gcc -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wredundant-decls. Closes #723788. Markus Armbruster 2004-02-20 20:45:18 +00:00
  • 46da1aec7a deity.h is redundant, remove it. Markus Armbruster 2004-02-20 20:34:43 +00:00
  • b4a7d9f022 The (unused) parameter of thread entry points is named argv', but the argument is actually the value of global variable player'. Rename to `unused'. Markus Armbruster 2004-02-20 20:14:53 +00:00
  • 14e0060a61 Update for 4.2.14. Markus Armbruster 2004-02-20 20:14:53 +00:00