misc_cmd.c
changeset 1858 3aa257df0e04
parent 1840 ce40137a6ab4
child 1877 ab6a315fa930
equal deleted inserted replaced
1857:f07b4fc6c4bf 1858:3aa257df0e04
   254  *           itself is changed. The new value is inside p2
   254  *           itself is changed. The new value is inside p2
   255  * @param p2 new value for a difficulty setting or difficulty level
   255  * @param p2 new value for a difficulty setting or difficulty level
   256  */
   256  */
   257 int32 CmdChangeDifficultyLevel(int x, int y, uint32 flags, uint32 p1, uint32 p2)
   257 int32 CmdChangeDifficultyLevel(int x, int y, uint32 flags, uint32 p1, uint32 p2)
   258 {
   258 {
   259 	if (p1 >= GAME_DIFFICULTY_NUM) return CMD_ERROR;
   259 	if ((int32)p1 >= GAME_DIFFICULTY_NUM && p1 != (uint32)-1L) return CMD_ERROR;
   260 
   260 
   261 	if (flags & DC_EXEC) {
   261 	if (flags & DC_EXEC) {
   262 		if (p1 != (uint32)-1L) {
   262 		if (p1 != (uint32)-1L) {
   263 			((int*)&_opt_ptr->diff)[p1] = p2;
   263 			((int*)&_opt_ptr->diff)[p1] = p2;
   264 			_opt_ptr->diff_level = 3; // custom difficulty level
   264 			_opt_ptr->diff_level = 3; // custom difficulty level