returns a stolen item to a player
| 3971 | |
| 3972 | // returns a stolen item to a player |
| 3973 | void ThiefReturnItem(int player_object_handle, int item) { |
| 3974 | object *pobj = ObjGet(player_object_handle); |
| 3975 | ASSERT(pobj); |
| 3976 | ASSERT(pobj->type == OBJ_PLAYER); |
| 3977 | |
| 3978 | int playernum = pobj->id; |
| 3979 | |
| 3980 | switch (item) { |
| 3981 | case THIEFITEM_AUTOMAP: |
| 3982 | if (playernum == Player_num) { |
| 3983 | for (int i = 0; i < MAX_ROOMS; i++) { |
| 3984 | if (AutomapVisMap[i] == 2) |
| 3985 | AutomapVisMap[i] = 1; |
| 3986 | } |
| 3987 | } |
| 3988 | break; |
| 3989 | case THIEFITEM_HEADLIGHT: |
| 3990 | Players[playernum].flags &= ~PLAYER_FLAGS_HEADLIGHT_STOLEN; |
| 3991 | break; |
| 3992 | // all others should be handled by their powerup |
| 3993 | } |
| 3994 | } |
| 3995 | |
| 3996 | // returns true if a player has the specified item to be stolen |
| 3997 | bool ThiefPlayerHasItem(int player_object_handle, int item) { |
no test coverage detected