luciensadi / AwakeMUD

The Community Edition fork of the 'Awakened Worlds' Shadowrun 3 MUD codebase.
Other
55 stars 31 forks source link

Cleaner graffiti messaging #652

Closed UndeadNappist closed 2 years ago

UndeadNappist commented 2 years ago

Removes quotation marks and 'is sprayed here' and replaces it with a single line at the top of the graffiti, supposedly.

luciensadi commented 2 years ago

Every call to snprintf overwrites the buffer. You might be looking for snprintf(ENDOF(buf), sizeof(buf) - strlen(buf),, but even that wouldn't work quite right for this case, because if I'm reading this right, the next time someone sprays you'll have:

Sprayed here,  %s^n
Sprayed here,  %s^n
  %s^n

What is your desired output? Can you test and see if you get that?

UndeadNappist commented 2 years ago

Desired output is

Sprayed here,
   %s^n
   %s^n

Currently just prints

   %s^n
   %s^n
UndeadNappist commented 2 years ago

image

Works correctly now.

luciensadi commented 2 years ago

Looks good, thanks!