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

◆ RecipeSanityCheck()

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

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

401 {
402 int check_results[MAX_INGREDIENTS];
403
404 for (int i = 0; i < num_of_ingredients;i++)
405 {
406 ItemBase item = items[i];
407 Man item_owner_player = item.GetHierarchyRootPlayer();
408 vector item_pos = item.GetPosition();
409 vector player_pos = player.GetPosition();
410
411 if (item_owner_player == player)
412 {
413 check_results[i] = check_results[i] | ERecipeSanityCheck.IS_IN_PLAYER_INVENTORY;
414 }
415
416 if ( item_owner_player == NULL || item_owner_player == player || !item_owner_player.IsAlive() )
417 {
418 check_results[i] = check_results[i] | ERecipeSanityCheck.NOT_OWNED_BY_ANOTHER_LIVE_PLAYER;
419 }
420
421 if ( vector.Distance(item_pos, player_pos ) < ACCEPTABLE_DISTANCE )
422 {
423 check_results[i] = check_results[i] | ERecipeSanityCheck.CLOSE_ENOUGH;
424 }
425 }
426 for (i = 0; i < num_of_ingredients;i++)
427 {
429 {
430 return false;
431 }
432 }
433 return true;
434 }
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().