Commit graph

590 commits

Author SHA1 Message Date
tjr1974
e9c9808a24
Update act.informative.c (#119)
Fixed formatting for readability.
Indentations should be correct.
Tested on fresh install. 
It does compile. 
Room descriptions display properly.
2022-11-16 23:08:33 +01:00
Thomas Arp
c9ebc7174c
Create build.yml (#117)
Support for building pull requests with github actions
2022-11-06 23:41:31 +01:00
Thomas Arp
bde600051d
Merge pull request #114 from Vatiken/master
Replaced missing semi-colon. -No Compile
2022-11-05 12:53:30 +01:00
Thomas Arp
a745935421
Merge pull request #113 from tbamud/zusuk-patch-1
Added check for NOTHING key in has_key()
2022-11-05 12:53:05 +01:00
Joseph
0ee3aac10d Replaced missing semi-colon. -No Compile 2022-11-04 21:02:35 -03:00
Thomas Arp
15074b1d93
Added check for NOTHING key in has_key() 2022-11-02 22:31:56 +01:00
Thomas Arp
8f67dd880c
Merge pull request #110 from tjr1974/master
Fixes & Code Quality
2022-10-25 00:36:18 +02:00
tjr1974
34aca229df
Update act.informative.c
Used code formatter to correct indentations and align all {} in lACMD(do_exits)
Checked for unmactched braces and found none.
My code editor shows all {} are matched.
2022-10-24 17:07:54 -05:00
tjr1974
041765438a
Update act.informative.c
Used code formatter to correct indentations and align all {} in the look_at_room()
Checked for unmactched braces and found none.
My code editor shows all {} are matched.
2022-10-24 16:38:11 -05:00
tjr1974
59398b2fdc
Update handler.c
Fixes indentations in obj_to_room()
2022-10-24 16:07:49 -05:00
tjr1974
97bd28ffd3
Update act.informative.c
Fixes unguarded blocks of code in ACMD(do_exits) that could cause the server to report scripted trigger events (mob movements, exit links to rooms being reassigned, and doors being opened or closed) as script errors. Particularly, if this code is copy and pasted into the do_auto_exits().
2022-10-23 15:29:43 -05:00
tjr1974
7039f9c402
Update act.informative.c
Fixes unguarded else clauses due to inconsistent use of {} in look_at_room().
2022-10-23 15:12:57 -05:00
tjr1974
3635026433
Update handler.c
Fixes the display order of objects in obj_to_room().
Objects are now displayed in the order they are placed/dropped. This prevents fountains, boards, etcetera from "moving" around the room.
2022-10-23 14:57:14 -05:00
Thomas Arp
16a46903e4
Merge pull request #103 from mackerel3/antipattern
use strncat(sizeof(...) - strlen(...) - 1)
2022-09-03 12:33:01 +02:00
Mackerel
2d8c05b4ed use strncat(sizeof(...) - strlen(...) - 1) 2022-09-03 00:11:03 -04:00
Thomas Arp
95d4da4972
Merge pull request #101 from ktpx/recent
inc size of name, max length names crash on addrecent due to buffer o…
2022-03-25 00:03:13 +01:00
Thomas
9c801f9ab6 inc size of name, max length names crash on addrecent due to buffer overflow 2022-03-24 22:46:43 +01:00
Rumble
5305783e1b Fixed World file errors 2021-03-06 19:29:28 +00:00
Rumble
68dd901943 Updated for 2021 release 2021-03-06 15:50:00 +00:00
Noah Cunningham
547c7ddccf
Fix for pointer in fread() db.c to fix Raspberry Pi load issue (#97)
This corrects an issue encountered when loading world information on the Raspberry Pi. Sometimes, there is a ~ stored in the memory location in front of tmp char array. The for loop will decrement below the starting memory address, making it read the ~ and think it's at the end of the room, causing an error and preventing the MUD from loading.

This change checks the memory address of tmp, ensuring it is > the starting memory address before decrementing it in the for() loop. Then, the if/else checks to ensure the carriage return and newline are properly placed to prevent duplication.
2020-11-16 12:36:04 -05:00
MBourne
dceb563a9b
Bug/drink containers (#94)
* Bugfix for name_from_drinkcon

* Newline at end of utils.c
2020-06-07 08:52:22 -04:00
Thomas Arp
c0fb6f8a71
Correct log message for strange room flags (#88)
Thanks to Cunning on the tba board for the bug report
https://www.tbamud.com/forum/4-development/4548-db-c-typo-in-parse-rooms#8633
2020-04-16 20:12:34 -04:00
Thomas Arp
1f520546b2
Merge pull request #84 from tbamud/crash-bug-in-object-drop-script
Crash bug in object drop script
2020-03-08 23:57:15 +01:00
Thomas Arp
6fede208d2
Gcc 9.2.1 warnings (#87)
* 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.

* fix gcc warning: truncation in strncat

In file included from /usr/include/string.h:494,
from sysdep.h:74,
from act.item.c:12:
In function ‘strncat’,
inlined from ‘name_from_drinkcon’ at act.item.c:804:5,
inlined from ‘name_from_drinkcon’ at act.item.c:769:6:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:136:10: warning: ‘__builtin_strncat’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
136 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
act.item.c: In function ‘name_from_drinkcon’:
act.item.c:797:16: note: length computed here
797 | cpylen = strlen(cur_name);
| ^~~~~~~~~~~~~~~~

* Whitespace cleanup before bugfix

* Fix warnings for gcc-9.2.1

Also, fixed an ancient FIXME and a known bad strcat usage.

spell_parser.c: In function ‘say_spell’:
spell_parser.c:135:75: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 216 [-Wformat-truncation=]
135 | snprintf(buf1, sizeof(buf1), "$n stares at you and utters the words, '%s'.",
| ^~
In file included from /usr/include/stdio.h:867,
from sysdep.h:69,
from spell_parser.c:12:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 43 and 298 bytes into a destination of size 256
2020-03-08 08:33:59 -04:00
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