- Dołączył
- Maj 22, 2008
- Posty
- 1206
- Liczba reakcji
- 202
Funkcja getArmor w silnikach 0.3.6pl1 i 0.4 pobiera pancerz ze wszystkich slot?w, w tym SLOT_AMMO, do kt?rego mo?na wsadzi? cokolwiek np. inny pancerz. Takie dzia?anie doprowadzi do zwi?kszenia wytrzyma?o?ci gracza, w szczeg?lno?ci przy zastosowanym mno?niku dla danej profesji jak? gracz posiada.
Fix dotyczy wersji, w kt?rych funkcja getArmor wygl?da tak:
[CPP]int32_t Player::getArmor() const
{
int32_t armor = 0;
for(int32_t i = SLOT_FIRST; i < SLOT_LAST; ++i)
{
if(Item* item = getInventoryItem((slots_t)i))
armor += item->getArmor();
}
if(vocation->getMultiplier(MULTIPLIER_ARMOR) != 1.0)
return int32_t(armor * vocation->getMultiplier(MULTIPLIER_ARMOR));
return armor;
}[/CPP]
Przerobiona przeze mnie funkcja getArmor() z TFS 1.0:
[CPP]int32_t Player::getArmor() const
{
int32_t armor = 0;
static const slots_t armorSlots[] = {SLOT_HEAD, SLOT_NECKLACE, SLOT_ARMOR, SLOT_LEGS, SLOT_FEET, SLOT_RING};
for(size_t i = 0; i < sizeof(armorSlots) / sizeof(armorSlots[0]); i++) {
Item* item = inventory[armorSlots];
if(item)
armor += item->getArmor();
}
if(vocation->getMultiplier(MULTIPLIER_ARMOR) != 1.0)
return int32_t(armor * vocation->getMultiplier(MULTIPLIER_ARMOR));
return armor;
}[/CPP]
Fix dotyczy wersji, w kt?rych funkcja getArmor wygl?da tak:
[CPP]int32_t Player::getArmor() const
{
int32_t armor = 0;
for(int32_t i = SLOT_FIRST; i < SLOT_LAST; ++i)
{
if(Item* item = getInventoryItem((slots_t)i))
armor += item->getArmor();
}
if(vocation->getMultiplier(MULTIPLIER_ARMOR) != 1.0)
return int32_t(armor * vocation->getMultiplier(MULTIPLIER_ARMOR));
return armor;
}[/CPP]
Przerobiona przeze mnie funkcja getArmor() z TFS 1.0:
[CPP]int32_t Player::getArmor() const
{
int32_t armor = 0;
static const slots_t armorSlots[] = {SLOT_HEAD, SLOT_NECKLACE, SLOT_ARMOR, SLOT_LEGS, SLOT_FEET, SLOT_RING};
for(size_t i = 0; i < sizeof(armorSlots) / sizeof(armorSlots[0]); i++) {
Item* item = inventory[armorSlots];
if(item)
armor += item->getArmor();
}
if(vocation->getMultiplier(MULTIPLIER_ARMOR) != 1.0)
return int32_t(armor * vocation->getMultiplier(MULTIPLIER_ARMOR));
return armor;
}[/CPP]