Artem_Bogdanow
Ученик
У меня вопрос я занимаюсь оптимизацией своего мода и хочу спросить
Данный вид написания кода даёт снижение нагрузки?
Код который был раньше:
Второй код:
Какой из выше представленых кодов более лучше и не несут нагрузку на мод?
Данный вид написания кода даёт снижение нагрузки?
Код который был раньше:
PHP:
if(HouseInfo[h][hKlass] == 0 && HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hTakings] -=180;
}
if(HouseInfo[h][hKlass] == 1 && HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hTakings] -=340;
}
if(HouseInfo[h][hKlass] == 2 && HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hTakings] -=480;
}
if(HouseInfo[h][hKlass] == 3 && HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hTakings] -=570;
}
if(HouseInfo[h][hKlass] == 4 && HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hTakings] -=640;
}
if(HouseInfo[h][hTakings] <= 0 && HouseInfo[h][hOwned] == 1)
PHP:
if(HouseInfo[h][hKlass] == 0 && HouseInfo[h][hOwned] == 1){
HouseInfo[h][hTakings] -=180;}
if(HouseInfo[h][hKlass] == 1 && HouseInfo[h][hOwned] == 1){
HouseInfo[h][hTakings] -=340;}
if(HouseInfo[h][hKlass] == 2 && HouseInfo[h][hOwned] == 1){
HouseInfo[h][hTakings] -=480;}
if(HouseInfo[h][hKlass] == 3 && HouseInfo[h][hOwned] == 1){
HouseInfo[h][hTakings] -=570;}
if(HouseInfo[h][hKlass] == 4 && HouseInfo[h][hOwned] == 1){
HouseInfo[h][hTakings] -=640;}
if(HouseInfo[h][hTakings] <= 0 && HouseInfo[h][hOwned] == 1)
