command.c
changeset 826 0e2b569b737b
parent 812 79c99885ad00
child 842 ebfd36603ab9
equal deleted inserted replaced
825:a830d6e67739 826:0e2b569b737b
   411 
   411 
   412 	// get pointer to command handler
   412 	// get pointer to command handler
   413 	assert((cmd & 0xFF) < lengthof(_command_proc_table));
   413 	assert((cmd & 0xFF) < lengthof(_command_proc_table));
   414 	proc = _command_proc_table[cmd & 0xFF];
   414 	proc = _command_proc_table[cmd & 0xFF];
   415 
   415 
   416 	// Some commands have a different output in dryrun then the realrun
   416 	// Some commands have a different output in dryrun than the realrun
   417 	//  e.g.: if you demolish a whole town, the dryrun would say okay.
   417 	//  e.g.: if you demolish a whole town, the dryrun would say okay.
   418 	//  but by really destroying, your rating drops and at a certain point
   418 	//  but by really destroying, your rating drops and at a certain point
   419 	//  it will fail. so res and res2 are different
   419 	//  it will fail. so res and res2 are different
   420 	// CMD_REMOVE_ROAD: This command has special local authority
   420 	// CMD_REMOVE_ROAD: This command has special local authority
   421 	// restrictions which may cause the test run to fail (the previous
   421 	// restrictions which may cause the test run to fail (the previous
   472 
   472 
   473 	// actually try and execute the command.
   473 	// actually try and execute the command.
   474 	_yearly_expenses_type = 0;
   474 	_yearly_expenses_type = 0;
   475 	res2 = proc(x,y, flags|DC_EXEC, p1, p2);
   475 	res2 = proc(x,y, flags|DC_EXEC, p1, p2);
   476 
   476 
   477 	// If notest is on, it means the result of the test can be different then
   477 	// If notest is on, it means the result of the test can be different than
   478 	//   the real command.. so ignore the test
   478 	//   the real command.. so ignore the test
   479 	if (!notest && !((cmd & CMD_NO_TEST_IF_IN_NETWORK) && _networking)) {
   479 	if (!notest && !((cmd & CMD_NO_TEST_IF_IN_NETWORK) && _networking)) {
   480 		assert(res == res2); // sanity check
   480 		assert(res == res2); // sanity check
   481 	} else {
   481 	} else {
   482 		if ((uint32)res2 >> 16 == 0x8000) {
   482 		if ((uint32)res2 >> 16 == 0x8000) {