DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ RecipeSanityCheck()

bool PluginRecipesManagerBase::RecipeSanityCheck ( int num_of_ingredients,
InventoryItemBase items[],
PlayerBase player )
inlineprotected

См. определение в файле PluginRecipesManager.c строка 407

408 {
409 int check_results[MAX_INGREDIENTS];
410
411 for (int i = 0; i < num_of_ingredients;i++)
412 {
413 ItemBase item = items[i];
414 Man item_owner_player = item.GetHierarchyRootPlayer();
415 vector item_pos = item.GetPosition();
416 vector player_pos = player.GetPosition();
417
418 if (item_owner_player == player)
419 {
420 check_results[i] = check_results[i] | ERecipeSanityCheck.IS_IN_PLAYER_INVENTORY;
421 }
422
423 if ( item_owner_player == NULL || item_owner_player == player || !item_owner_player.IsAlive() )
424 {
425 check_results[i] = check_results[i] | ERecipeSanityCheck.NOT_OWNED_BY_ANOTHER_LIVE_PLAYER;
426 }
427
428 if ( vector.Distance(item_pos, player_pos ) < ACCEPTABLE_DISTANCE )
429 {
430 check_results[i] = check_results[i] | ERecipeSanityCheck.CLOSE_ENOUGH;
431 }
432 }
433 for (i = 0; i < num_of_ingredients;i++)
434 {
436 {
437 return false;
438 }
439 }
440 return true;
441 }
class GP5GasMask extends MaskBase ItemBase
const int SANITY_CHECK_ACCEPTABLE_RESULT
Определения PluginRecipesManager.c:10
ERecipeSanityCheck
Определения PluginRecipesManager.c:2
enum ERecipeSanityCheck ACCEPTABLE_DISTANCE
const int MAX_INGREDIENTS
Определения PluginRecipesManager.c:21

Перекрестные ссылки ACCEPTABLE_DISTANCE, vector::Distance(), MAX_INGREDIENTS и SANITY_CHECK_ACCEPTABLE_RESULT.

Используется в IsRecipePossibleToPerform() и PerformRecipeServer().