porting OasisOLC II to Smaug 1.4 - anyone have snippet instructions handy?

Posted by Gdub on Mon 22 Apr 2024 09:04 PM — 3 posts, 6,786 views.

#0
I've downloaded the Smaug 2.0 codebase, ported over the relevant files to our 1.4 code base. I have it compiling but only because I commented out some of the bits that aren't lining up. I don't quite understand (yet) the pieces that I've had to comment out and figured this might be a good place to ask questions?

specifically
- container_flags is a new array? previously was done with #defines?
- I had to comment out lines like this as its balking on the #define xTOGGLE_BIT(var, bit) ((var).bits[(bit) >> RSV] ^= 1 << ((bit) & XBM)) macro. Something about .bits not being a union

 ch_printf_color( d->character, "\n\rRoom flags: c%s&w\n\rEnter room flags, 0 to quit : ", ext_flag_string( &room->room_flags, r_flags ) );


I've searched all the sites and haven't come across the original installation instructions yet. any input would be greatly appreciated!
Australia Forum Administrator #1
I don't have any snippets, but as for the define, can you copy and paste the exact error message?
#2
Thank you Nick.

here's one of the errors during compiling.


In file included from oredit.c:49:
oredit.c: In function 'redit_parse':
mud.h:3108:39: error: request for member 'bits' in something not a structure or union
 3108 | #define xTOGGLE_BIT(var, bit)   ((var).bits[(bit) >> RSV] ^= 1 << ((bit) & XBM))

this is the macro its calling:

#define xTOGGLE_BIT(var, bit)	((var).bits[(bit) >> RSV] ^= 1 << ((bit) & XBM))

I'm also a bit worried about adding this array to bypass a compile error as the 1.4 version uses defines for these flags

char* const   container_flags[] =
{
	"closeable", "pickproof", "closed", "locked", "eatkey", "r1", "r2", "r3",
	"r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
	"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26",
	"r27"
};
...
#define EX_DIG			  BV08
#define EX_EATKEY		  BV09
#define EX_NOPASSDOOR	          BV10
#define EX_HIDDEN		  BV11
#define EX_PASSAGE		  BV12
#define EX_PORTAL 		  BV13
...