MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ThiefReturnItem

Function ThiefReturnItem

Descent3/Player.cpp:3973–3994  ·  view source on GitHub ↗

returns a stolen item to a player

Source from the content-addressed store, hash-verified

3971
3972// returns a stolen item to a player
3973void 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
3997bool ThiefPlayerHasItem(int player_object_handle, int item) {

Callers 1

HandleCommonPowerupsFunction · 0.85

Calls 1

ObjGetFunction · 0.85

Tested by

no test coverage detected