Blizzru
offline
Опыт:
4,117Активность: |
Первый мой спелл - код...
Гдето краем уха я слышал, что от BJ функций лучше избавляться...
Тут есть строка содержащая BJ что мне с ней делать?
Вот эта строка...
|
23.02.2012, 16:31 | #1
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Hanabishi
COOL STATUS
offline
Опыт: отключен
|
Blizzru, жутко утечный неоптимальный код.
Вот так лучше, но всё равно через вейт не одобряю.
|
23.02.2012, 17:07 | #2
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Ty3uK
offline
Опыт:
2,469Активность: |
Объявление локальных переменных должно быть в самом начале функций. То есть строчку с local поставь перед строчкой с set (первую и вторую строку события поменять)
Ty3uK добавил: Hanabishi, а ордер через ид почему бы не отдать? |
23.02.2012, 17:08 | #3
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Hanabishi
COOL STATUS
offline
Опыт: отключен
|
Ty3uK, разницы нет, а ид искать лень =Р |
23.02.2012, 17:10 | #4
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Ty3uK
offline
Опыт:
2,469Активность: |
Разве нет? Просто всегда считал, что через ид быстрее работает :)
|
23.02.2012, 17:13 | #5
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
alpha
offline
Опыт:
7,387Активность: |
вот тебе более-менее быстрый алгоритм
вэйт выпели лучше
» code
Ty3uK:
потеря в читабельности происходит)
имея нормальный JNGP это не важно
Использовать еще лучше вместо Player натив-функции переменную
типа такой:
» code
|
23.02.2012, 17:50 | #6
+0/−1
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Blizzru
offline
Опыт:
4,117Активность: |
Помоему пару строчек лучше чем 100500 |
23.02.2012, 18:12 | #7
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Ty3uK
offline
Опыт:
2,469Активность: |
Одним jngp дело не заканчивается. А автор, видимо, юзает обычный ве. Про него тоже забывать не стоит
|
23.02.2012, 18:23 | #8
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
alpha
offline
Опыт:
7,387Активность: |
чем? байтами кода?
читобельностью разве что Я уточнил просто, для общего развития) |
23.02.2012, 18:24 | #9
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Blizzru
offline
Опыт:
4,117Активность: |
Hanabishi, это что за Bj? Без неё никак?
alpha,
с твоими алгоритмами...
Помоему не быстрее... это ведь обычные глобалки... Отредактировано Blizzru, 23.02.2012 в 18:34. |
23.02.2012, 18:25 | #10
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
alpha
offline
Опыт:
7,387Активность: |
|
23.02.2012, 18:27 | #11
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Doc
offline
Опыт:
63,163Активность: |
alpha, если уж делать массив, то имхо заносить туда только играющих/нужных, а потом уже на них все регать. |
23.02.2012, 18:31 | #12
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
alpha
offline
Опыт:
7,387Активность: |
Понятное дело, откуда мне знать кто там у него является нужным, а кто ненужным?
alpha добавил:
Blizzru, пользуйся похожей конструкцией: ((код jass
function UnitEvent takes trigger a, playerunitevent b returns nothing call TriggerRegisterPlayerUnitEvent(a,W[0],b,null) call TriggerRegisterPlayerUnitEvent(a,W[1],b,null) call TriggerRegisterPlayerUnitEvent(a,W[2],b,null) call TriggerRegisterPlayerUnitEvent(a,W[3],b,null) call TriggerRegisterPlayerUnitEvent(a,W[4],b,null) call TriggerRegisterPlayerUnitEvent(a,W[5],b,null) call TriggerRegisterPlayerUnitEvent(a,W[6],b,null) call TriggerRegisterPlayerUnitEvent(a,W[7],b,null) call TriggerRegisterPlayerUnitEvent(a,W[8],b,null) call TriggerRegisterPlayerUnitEvent(a,W[9],b,null) call TriggerRegisterPlayerUnitEvent(a,W[10],b,null) call TriggerRegisterPlayerUnitEvent(a,W[11],b,null) endfunction )) |
23.02.2012, 18:36 | #13
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Blizzru
offline
Опыт:
4,117Активность: |
При загрузке (почти в самом конце) выкидывает Fatal Error.
|
23.02.2012, 18:38 | #14
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
alpha
offline
Опыт:
7,387Активность: |
где результаты отладки?
alpha добавил:
[Debug log] Над системами трудились не для того чтобы они пылились |
23.02.2012, 18:43 | #15
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Blizzru
offline
Опыт:
4,117Активность: |
BoT |
23.02.2012, 18:47 | #16
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
alpha
offline
Опыт:
7,387Активность: |
понятие "отладка" кури |
23.02.2012, 18:48 | #17
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Blizzru
offline
Опыт:
4,117Активность: |
alpha, сорь... непонял. блондин оО |
23.02.2012, 18:56 | #18
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Ty3uK
offline
Опыт:
2,469Активность: |
Кстати, разве GetWidgetX/Y не работает быстрее, чем GetUnitX/Y?
|
23.02.2012, 18:56 | #19
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Hanabishi
COOL STATUS
offline
Опыт: отключен
|
Это просто константа, максимальное число игровых слотов. Можешь заменить просто на 16. Да, есть косяк, исправил:
|
23.02.2012, 22:50 | #20
+1/−1
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|