char_player_data expansion

  • jandulio
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 months 1 week ago - 6 months 1 week ago #9999 by jandulio
char_player_data expansion was created by jandulio
1) I added the functionality for multi-classing in my game (Warrior/Thief/Cleric,etc) but when I first tried to do it, I added 4 ints in the middle of the char_player_data struct.  When I did that, it segfaulted loading trigger code.  I figured there was something loading using the struct, so I ended up putting the 4 ints at the END of the struct and everything seems to be working fine.

The question is, can I ADD onto the char_player_data struct without causing some unseen issue(s)?  I hope someone knows!

EDIT: I figured out the 2nd question I had in this post.


Thanks!
Last edit: 6 months 1 week ago by jandulio.

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #10000 by thomas
Replied by thomas on topic char_player_data expansion
Ok, this was so puzzling I had to test it myself.

I added a couple of dummy int values to structs.h:
/** General info used by PC's and NPC's. */
struct char_player_data
{
  char passwd[MAX_PWD_LENGTH+1]; /**< PC's password */
  char *name;                    /**< PC / NPC name */
  char *short_descr;             /**< NPC 'actions' */
  char *long_descr;              /**< PC / NPC look description */
  char *description;             /**< NPC Extra descriptions */
  char *title;                   /**< PC / NPC title */
  int dummy1;
  int dummy2;
  int dummy3;
  int dummy4;
  byte sex;                      /**< PC / NPC sex */
  byte chclass;                  /**< PC / NPC class */
  byte level;                    /**< PC / NPC level */
  struct time_data time;         /**< PC AGE in days */
  ubyte weight;                  /**< PC / NPC weight */
  ubyte height;                  /**< PC / NPC height */
};
Nothing bad happened after a recompile. Until further evidence is unearthed, this one is a clear "cannot reproduce".

Please Log in or Create an account to join the conversation.

  • jandulio
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 months 1 week ago #10002 by jandulio
Replied by jandulio on topic char_player_data expansion
I just tried this on a stock build of tbaMUD 2020 and it works fine. This is obviously something that I have introduced. So sorry to have you test this. Next time I will try on stock before posting!

Please Log in or Create an account to join the conversation.

Time to create page: 0.138 seconds