Skip to content

Conversation

@diamondo25
Copy link
Contributor

@diamondo25 diamondo25 commented Oct 21, 2016

This command supports the following 'placeholders':

  • lNNN for writing int64
  • iNNN for writing uint32
  • sNNN for writing uint16
  • bNNN for writing uint8
  • "text" for writing a string

Also i fixed/expanded the atoli() function. It now acts more like atoi, where it has to remove whitespaces (using isspace) first, then check for the plus/minus sign, and after that finally parse the numbers. After that, make the value negative, of course.

This command supports the following 'placeholders':
 - lNNN for writing int64
 - iNNN for writing int32
 - sNNN for writing int16
 - bNNN for writing int8
 - "text" for writing a string

Also i fixed/expanded the atoli() function. It now acts more like atoi, where it has to remove whitespaces (using isspace) first, then check for the plus/minus sign, and after that finally parse the numbers. After that, make the value negative, of course.
…last bit, thus making it non-negative values.
chat_handler_functions::show_info(player, "Number '" + value_string + "' is not between 0 and " + lexical_cast<string>(UINT16_MAX));
return chat_result::handled_display;
}
packet.add<int16_t>(static_cast<int16_t>(value));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is intentional that you don't cast to uint16_t here? Same for these other casts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants