Vampirrr
O_o
offline
Опыт:
19,286Активность: |
Нужна помощь с оптимизацией
в общем вот код
Код:
Если возможно, избавьте от утечек и оптимизируйте. Игра пошаговая, сотни действий в секунду не выполняются, дикие конвертации кода тоже не нужны. Нужно просто поерхностное шлифование и избавление от самых неприятных гадостей. Спасибо. Отредактировано Vampirrr, 04.01.2009 в 20:35. |
04.01.2009, 20:09 | #1
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
ScorpioT1000
Работаем
offline
Опыт: отключен
|
а почему координаты переводятся в целый тип? |
04.01.2009, 20:21 | #2
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vampirrr
O_o
offline
Опыт:
19,286Активность: |
ScorpioT1000, выдает cannot convert real to integer..просто наверное перменные сделать нужно не integer а real =)
|
04.01.2009, 20:25 | #3
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
ScorpioT1000
Работаем
offline
Опыт: отключен
|
ну я и говорю что они и должны быть с точкой зачем приводить к единицам |
04.01.2009, 20:34 | #4
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vampirrr
O_o
offline
Опыт:
19,286Активность: |
ScorpioT1000, как бы это и все? O_o мне говорили что тут 3 утечки..
Отредактировано Vampirrr, 04.01.2009 в 20:51. |
04.01.2009, 20:35 | #5
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Integro
старожило
offline
Опыт:
630Активность: |
Код:
Не нравица мне эта функция, как я пральна понемаю тут возвращается true...ведь в операторе if нету действий... проще будет: Код:
Отредактировано Integro, 04.01.2009 в 21:10. |
04.01.2009, 21:04 | #6
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Scorched
offline
Опыт:
7,912Активность: |
Цитата:
автор пытался оптимизировать, но сделал неправильно. эту функцию надо привести к одной строчке вида return a and b or c or d. не использовать эту CreateNUnitsAtLoc. да и много еще по мелочам Scorched добавил: опередели... =\ еще не юзать !=true и ==true, глаза режет |
|
04.01.2009, 21:13 | #7
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
ELDAR
НИИ 4А-ВО кафедра SPELLS
offline
Опыт:
8,394Активность: |
Vampirrr соб-сно
CreateNUnitsAtLoc - отстой меняй на вот эту нативку Код:
|
04.01.2009, 21:22 | #8
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Integro
старожило
offline
Опыт:
630Активность: |
Ну я думаю чтото вроде так:
Код:
Толком небуду расбиратся, голова болит, уже... |
04.01.2009, 21:24 | #9
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vampirrr
O_o
offline
Опыт:
19,286Активность: |
Integro, оно было в строчку, это я их так сместил, что б вам легче читать было) но к сожалению оно не работало как надо, поэтому сделал это:
Код:
Scorched, на что можно изменить CreateNUnitsAtLoc? (ответили уже)) И про утечки не забывайте) |
04.01.2009, 21:24 | #10
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Scorched
offline
Опыт:
7,912Активность: |
Vampirrr, с условиями сделай как Integro написал, +1 ему. ==true удаляй вообще (ибо не имеет смысла). а (выражение)!=true замени на not (выражение), так понтовее =)
|
04.01.2009, 21:41 | #11
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vampirrr
O_o
offline
Опыт:
19,286Активность: |
Integro, когда сделал это -
Код:
матчинг стал срабатывать непаравильно и не создается юнита с ID 'h000' ..очень странно.. Condition +1 вот что имеем: Код:
Отредактировано Vampirrr, 04.01.2009 в 22:15. |
04.01.2009, 21:43 | #12
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
ShadoW DaemoN
offline
Опыт:
37,078Активность: |
Код:
Код стал более понятным, имхо. |
05.01.2009, 09:28 | #13
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vampirrr
O_o
offline
Опыт:
19,286Активность: |
всем спс, темку закрыть) |
08.01.2009, 18:58 | #14
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|