Commit graph

566 commits

Author SHA1 Message Date
Thomas Arp
fc223452e8 Fix typo in previous commit.
Also, inline lookup functions if possible.
2020-03-07 23:24:32 +01:00
Thomas Arp
a60f0eefb8 Minor bugfix in code that should be unreachable.
We already log that we update, but no update was taking place.
2020-03-07 23:22:01 +01:00
Thomas Arp
53870eba5d Added further failsafes to prevent dereferencing free'd objects
"obj" variable is not updated here, so we must lookup to see if it has
been free'd in script_driver().

Fixes #83
2020-03-01 01:27:57 +01:00
Thomas Arp
d5a11618f1 Remove crash bug when purging a dropped item in a wtrigger.
We're leveraging the lookup table, because it's a safer way
to see if an object has been free'd than looking at the object
itself (which while it may work may just as well fail).

Fixes #83
2020-03-01 01:19:06 +01:00
Thomas Arp
140cdc5d22 Merge branch 'master' of github.com:tbamud/tbamud 2020-02-29 14:33:30 +01:00
Thomas Arp
eb650c2811
GitHub issues 78 79 81 num aff flags off by one (#82)
* Make sure all followers are free'd before freeing the character list

Otherwise, the followers structs will point to free'd memory and
the stop_follower call will attempt to dereference a free'd
characters' followers list.

* https://github.com/tbamud/tbamud/issues/79 typo

* https://github.com/tbamud/tbamud/issues/81 nullpointer crash on syntax check run

* NUM_AFF_FLAGS fix.

Now, consistently, the NUM_AFF_FLAGS is used in the same way as other
NUM_* variables. Specifically, the the number is consistent with
how others are defined - 1 above the highest in the list.

I would like to have removed the need to start from 1 instead of 0
as well, but the loading mechanism, and thus potentially a lot of
existing object files, use 0 as a marker for "no flags set", and
we can't easily fix that. So, the places we loop through the list,
we still need to make sure we're stying within the [1;NUM_AFF_FLAGS) interval.

Simultaneously, I've checked over the other flags, and it seems like
the usage is pretty consistent there.

Fixes https://github.com/tbamud/tbamud/issues/78
2020-02-25 18:39:29 -05:00
Thomas Arp
4f875db90e Merge branch 'master' of github.com:tbamud/tbamud 2020-02-25 22:46:53 +01:00
Thomas Arp
7f0acefcb4 Confusing code fix (#76)
* Make sure all followers are free'd before freeing the character list

Otherwise, the followers structs will point to free'd memory and
the stop_follower call will attempt to dereference a free'd
characters' followers list.

* Make sure %target% works in act triggers

* code cleanup. Remove inline block, make variable names more understandable.

Ref https://www.tbamud.com/forum/4-development/4525-confused-over-piece-of-code-in-parse-room
2020-01-26 16:19:10 -05:00
Thomas Arp
28ca86645b Merge branch 'master' of github.com:tbamud/tbamud 2020-01-26 21:43:08 +01:00
Thomas Arp
1ab51a0545 Make sure all followers are free'd before freeing the character list (#75)
Otherwise, the followers structs will point to free'd memory and
the stop_follower call will attempt to dereference a free'd
characters' followers list.
2020-01-19 08:44:21 -05:00
Thomas Arp
bf31d98414 Make sure all followers are free'd before freeing the character list
Otherwise, the followers structs will point to free'd memory and
the stop_follower call will attempt to dereference a free'd
characters' followers list.
2020-01-19 14:40:33 +01:00
Rumble
934d83b829 Updating for 2020 release.
Merge branch 'master' of https://github.com/tbamud/tbamud
2020-01-14 20:08:23 +01:00
Rumble
4214a3e31e Updated for 2020 release 2020-01-14 20:02:24 +01:00
Thomas Arp
462807d9e8 Fixes for w-format-truncation. Also, export of zones work again on linux (#74) 2020-01-10 19:28:09 -05:00
Thomas Arp
29f19f9ce5 Fixes for w-format-truncation. Also, export of zones work again on linux 2020-01-11 01:05:32 +01:00
Jason 'Opie' Babo
b028d60749
Merge pull request #73 from steaphangreene/fix-typos
Yet more simple fixes, mostly spelling.
2019-11-30 14:35:33 +00:00
Steaphan Greene
d8291143f3 Yet more simple fixes, mostly spelling.
This should be my last batch of these big fixes.

That's not to say there aren't still more things to fix.  There
certainly are.  But, I expect my future fixes will be smaller.
2019-11-30 09:30:22 -05:00
Steaphan Greene
d7b07c3586 More simple typo/spelling fixes. (#72)
My second batch, there are yet more of these coming.
2019-11-25 13:57:43 -05:00
Jason 'Opie' Babo
65937cd820
Merge pull request #71 from steaphangreene/fix-typos
Some simple typo/spelling fixes.
2019-11-24 21:07:55 +00:00
Steaphan Greene
b7b2b2fa84 Some simple typo/spelling fixes.
There are more of these coming - this is just my first batch.
2019-11-24 15:46:01 -05:00
Jason 'Opie' Babo
91bc4dba02
Merge pull request #70 from steaphangreene/standardize-spellings
So long as every word that is tied to a command is the same, it's all good!
2019-11-24 18:21:56 +00:00
Steaphan Greene
1f7c168121 Standardize on American spellings.
Full internationalization would be much cooler, but that's never going
to happen.  Given that, this will at least prevent folks from constantly
having to look and switch between typing "armor" and "armour", depending
on which zone each item originated in, etc.

I could flip these either way, but a survey of the current state shows
that about 80% of the mixed cases use the American spellings, while 20%
use the British.  And, most words *only* exist in this data in their
American forms.  So, it seems the majority prefer these spellings.

In case anyone likes trivia:
* The most common mixed words in here were "armour" and "colour", each of
  which occured about half as often as "armor" and "color", respectively.
* The most British word in here was "theatre" (including other forms),
  which occured about twice as often as "theater".

This stanardizes all of these (and other forms of these same words):
* armour -> armor
* colour -> color
* favour -> favor
* honour -> honor
* civilise -> civilize
* centre -> center
* theatre -> theater
* defence -> defense
* offence -> offense
* realise -> realize
2019-11-24 12:53:10 -05:00
Jason 'Opie' Babo
2fba5240c1
Merge pull request #69 from steaphangreene/extra-if-spaces
Remove extra spaces inside parens in a some expressions.
2019-11-24 16:54:41 +00:00
Steaphan Greene
dee749d30c Remove extra spaces inside parens in a some expressions.
Functionally, this is a non-change.
This just conforms a few odd cases to be the same as the rest.

`git show -w` shows nothing (this is a whitespace-only change).
2019-11-24 11:45:56 -05:00
Jason 'Opie' Babo
6b9df83fe3
Merge pull request #68 from steaphangreene/case-fixes
Normalize case in many TBA script commands.
2019-11-18 21:16:38 +00:00
Jason 'Opie' Babo
c339bab6cc
Merge pull request #67 from steaphangreene/data-fixes
Various TBA data fixes.
2019-11-18 21:13:44 +00:00
Steaphan Greene
458447512d Normalize case in many TBA script commands.
Since circle/tba is not case-sensitive, this should be a non-change.
I confirmed this by verifying that `diff -i` shows zero changes.

So, to tba, this is just a cosmetic cleanup.

However, to others that use this data, the case might be important.
...this includes my own separate MUD codebase. :)
2019-11-18 13:06:53 -08:00
Steaphan Greene
59cee1ff53 Various TBA data fixes.
These all seem to be corrupted data, plus one rogue non-ascii character.

I don't think any of these are controversial.  These are clearly all bugs.
2019-11-18 13:02:11 -08:00
Steaphan Greene
c59c321d5d TBA data file whitespace cleanups. (#66)
This just converts the few DOS text files still in here to standard text files (line-endings),
removes all the trailing spaces on lines, removes all the trailing blank lines, and replaces
all the tabs (except in .zon files, where they seem to be common) with expanded spaces.

It's easy to confirm this is actually a non-change, except for whitespace:
* `git show -w` shows this commit as only removing 8 trailing blank lines.

This should make no difference to tbaMUD itself, but it will make working on these files,
especially with scripts and automated tools, much easier.

This is the base change for a set of other changes I will put up once/if this merges,
without this, the others are just too complicated to wrangle.
2019-11-18 12:53:47 -05:00
Steaphan Greene
9856fca4e3 Fix a few apparent TBA world consistency errors. (#65)
These are mostly cases of confusion between the "on the body"
and "about the body" slots (5 and 12).

But, there are also some that seem to just be misconfigured,
like non-weapons being wielded, worn items being unwearable,
weapons being worn instead of wielded, and items being worn
instead of held.

I have an independent MUD codebase that reads these files, and
so this gives me an ability to somewhat orthogonally test these,
and easily find this sort of issue.

I did avoid all the cases where it was clear this was done
intentionally, like all the cases where the second neck was
used for the missing face slot (masks, etc).

The ones fixed here all seem to really be (minor) bugs.
2019-11-17 21:52:01 -05:00
Steaphan Greene
ece0bfd8e0 Minor fixes for done/end markers in one script. (#63)
I don't know dg_script well at all, so I could be mistaken.
But, I think these are just minor errors in this script.

I have a separately-implemented mud codebase that interprets the
worlds from tbamud, and it flags these as errors, and some other
issues I might chose to fix later, depending on how this PR goes. :)

Of course, it's possible this is really a bug in my own codebase, and
not in these scripts... but I don't think so - and the documentation
I've managed to find seems to confirm my suspicion.
2019-11-17 15:48:41 -05:00
Steaphan Greene
3f1ea5e7a5 Undo apparent accidental @-color replaces in upstream TBA files. (#62)
I am guessing some script or tool used upstream is doing an unsafe
search-and-replace for '@' with TAB, and accidentally changing these.
They seem to have been creeping into the repo for years.

I produced this fix commit automatically with:
  sed -i 's|\t\([bcdgmnoruwyBCDGMRWY]\)|@\1|g' tba/*/*.*
...and then a few files' changes had to be undone.

I looked through all of the rest, and they look like correct fixes.

I also ran all the other letters, and they only make incorrect "fixes".
2019-11-17 15:46:39 -05:00
Steaphan Greene
3e03332f0a Normalize a few spell names. (#64)
This just makes all dg_casts use the same name for the same spell.

Some of these are just short names, at least one seems to be a typo.
2019-11-17 15:45:51 -05:00
Fiztba
0a9cab1109 Zonereset Fix (#60)
* Fixed Zoneresets Confirmation Message

* Quick fix for Zonereset Toggle
2019-11-05 08:15:09 -05:00
Cat
43bf0e8f84 Make builds work on FreeBSD and OpenBSD (#58)
* make Makefile more portable

tbamud doesn't build on FreeBSD or OpenBSD.  This series of commits are meant to make those builds work by making the Makefile more portable.
I should mention that I've never used tbamud before today, so please read my pull request carefully.

This commit itself fixes the first issue encountered.  I assume wildcard and patsubst are gmake-only.

* Update Makefile.in

It turns out using the backslash to escape newlines in this situation is not portable.

* Delete Makefile.in

Will re-add.  There are problems with this file.  It's marked executable when it shouldn't be, and has ^M characters which prevent builds on OpenBSD.

* re-add Makefile.in
2019-04-30 07:57:21 -04:00
Rumble
674fbfddf1 Updated for 2019 release 2019-01-19 23:25:38 +00:00
wyld-sw
7c5e92d4c7 Corrected logic preventing writing mobile records. 2018-12-27 15:29:53 -05:00
Kevin Fischer
3cb8e52043 Fix error in "last all" command and several -Wunused-result compiler errors (#55)
* Add build generated files to .gitignore

* Fix error in "last all" output and resolve Wunused-result warnings

- Check return value of several standard library calls that could
return error states.
- Fix issue with "last all" command (it sent tabs for alignment
that were reinterpreted as colors).

* Fix buffer overflow in do_export_zone command
2018-07-21 19:37:18 -04:00
Kevin Fischer
b27003e881 Make some string ops bounded and fix bug in editor toggle command (#54)
* Replace a few strcat/sprintf instances with bounded variants

Also cleaned up the whitespace in the parse_edit_action function as it was
not consistent.

Fix bug in editor format command introduced in earlier commit

* Fix bug in editor toggle command when an escaped @ is in the buffer

Previously, toggling between @ and \t would always try to convert
@ to \t, even if already toggled, iff an escaped @ was present in the
buffer (i.e. '@@').
2018-07-16 05:17:45 -04:00
Kevin Fischer
14855c273a Fix string truncation warnings (Wstringop-truncation) (#53) 2018-07-15 17:23:26 -04:00
Kevin Fischer
ad88f94a46 Fix format overflow issues (#52)
Replace a few sprintf calls with snprintf to prevent buffer overflow.
Added error messages to the logs where buffer size prevents a room,
object, mobile, or quest from being saved to disk.
2018-07-15 11:52:27 -04:00
wyld-sw
bf941bc9b2 Removed dead stores. 2018-07-15 10:33:06 -04:00
Kevin Fischer
5cca63a01c Resolve Wrestrict warnings on GCC 8.1.1 (#51)
* Fix several misleading indentation warnings on GCC 8.1.1

* Fix reliance on undefined strcpy/sprintf behavior (-Wrestrict warnings)

The standard states that strcpy results in undefined behavior when the source
and destination buffers overlap. I resolved this with a combination of memmove
and strlen. Note that the resulting code is slightly less efficient.

Similarly, sprintf's behavior is undefined when copying takes place between
objects that overlap. I replaced most of these with a simple strcat, though
one required a temp buffer.

* Fix format in improved-edit.c to match surrounding code
2018-07-14 14:11:47 -04:00
Kevin Fischer
f9903c05b3 Fix several misleading indentation warnings on GCC 8.1.1 (#50) 2018-07-14 12:31:20 -04:00
wyld-sw
c0ac6069f6 Reverted unintentional change affecting minimap placement. 2018-07-08 17:09:40 -04:00
Thomas Arp
68b9b35404
Merge pull request #49 from tbamud/isname-bugfix
Revert "Multiple keyword support (#46)"
2018-04-12 22:52:19 +02:00
Thomas Arp
d070a188f6 Revert "Multiple keyword support (#46)"
This reverts commit 168f6df
2018-04-12 22:50:38 +02:00
Thomas Arp
b57e3d1ad7 Make sure vict is valid_dg_target in do_mteleport (#48)
Also, trigger world enter trigger for the newly moved target, not the caller.
2018-04-07 11:13:27 -04:00
Bobsson
168f6df908 Multiple keyword support (#46)
* Support for multiple keywords in item commands

* Free the new array so we don't leak memory
2018-03-18 17:09:38 -04:00
Nauzhror
4ff9d28054 do_detach (#45)
Made detach able to remove triggers from rooms you are not in. Made its argument handling better match the usage syntax when targeting rooms. Removed player attachable script check because it is possible to have scripts attached from before the functionality was deactivated. Made confirmation messages more informative.
2018-02-16 21:43:08 -05:00