equal
deleted
inserted
replaced
316 uint tile = TILE_FROM_XY(x,y); |
316 uint tile = TILE_FROM_XY(x,y); |
317 Player *p = DEREF_PLAYER(_current_player); |
317 Player *p = DEREF_PLAYER(_current_player); |
318 int score; |
318 int score; |
319 int32 cost = 0; |
319 int32 cost = 0; |
320 |
320 |
|
321 SET_EXPENSES_TYPE(EXPENSES_PROPERTY); |
|
322 |
321 if (CheckFlatLandBelow(tile, 2, 2, flags, 0, NULL) == CMD_ERROR) |
323 if (CheckFlatLandBelow(tile, 2, 2, flags, 0, NULL) == CMD_ERROR) |
322 return CMD_ERROR; |
324 return CMD_ERROR; |
323 |
325 |
324 if (p1) |
326 if (p1) |
325 cost = DoCommand(GET_TILE_X(p->location_of_house)*16, GET_TILE_Y(p->location_of_house)*16, p1&0xFF, 0, flags, CMD_DESTROY_COMPANY_HQ); |
327 cost = DoCommand(GET_TILE_X(p->location_of_house)*16, GET_TILE_Y(p->location_of_house)*16, p1&0xFF, 0, flags, CMD_DESTROY_COMPANY_HQ); |
358 /* p1 = owner of the HQ */ |
360 /* p1 = owner of the HQ */ |
359 int32 CmdDestroyCompanyHQ(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
361 int32 CmdDestroyCompanyHQ(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
360 { |
362 { |
361 uint tile = TILE_FROM_XY(x,y); |
363 uint tile = TILE_FROM_XY(x,y); |
362 Player *p; |
364 Player *p; |
|
365 |
|
366 SET_EXPENSES_TYPE(EXPENSES_PROPERTY); |
363 |
367 |
364 if ((int)p1 != OWNER_WATER) // destruction was initiated by player |
368 if ((int)p1 != OWNER_WATER) // destruction was initiated by player |
365 p = DEREF_PLAYER((byte)p1); |
369 p = DEREF_PLAYER((byte)p1); |
366 else { // find player that has HQ flooded, and reset their location_of_house |
370 else { // find player that has HQ flooded, and reset their location_of_house |
367 bool dodelete = false; |
371 bool dodelete = false; |