Thread: Switch command
View Single Post
Old 05-14-2003, 04:13 AM   #7
karlan
Member
 
Join Date: Apr 2002
Location: Brisbane Australia
Posts: 74
karlan is on a distinguished road
Arrow

I Imagine ROM handles it in a fairly standard fashion, in those functions/sections there is probably a check something like IS_NPC(ch) or IS_MOB(ch) or something like this, if the condition (not really the right word) that indicates if a character is based on an index, or identitiy number then you are a mob regardless of if switched or not, if the check is based on the presence of a descriptor then switching into a mob would in effect turn that mob into a player (YES! I know there are other issues like the presence of pcdata/mobdata structures internal to it, but this is a simplified explanation)

For example - most of the colour handling routines I have seen have a check [code] if(!IS_NPC(ch)) {
  // parse the colour codes
} else {
  // strip the colour codes <-- really a parse too
}[/quote]
this is a trivial example, but if that check "IS_NPC" only checks for the condition/index/id/BIG_SIGN/whatever that marks it as a mob it will always strip the codes. If IS_NPC checks for a descriptor then it would parse the codes, BUT then you get issues with having to copy prefernecs and so on <- see earlier post.
karlan is offline   Reply With Quote