Selecting a locked gate and an unlocked gate at the same time gives this error:
ERROR: JavaScript error: gui/session/selection_panels.js line 451
TypeError: property "locked" is non-configurable and can't be deleted
Differential D1004
Read-only Gate selection panel issue temple on Nov 1 2017, 11:39 PM. Authored by
Details
Selecting a locked gate and an unlocked gate at the same time gives this error:
Patch fixes it.
Diff Detail
Event TimelineComment Actions Nice find. If you ever see such read-only errors, you can assign me. #4257 The unintentional entity state modification you discovered was introduced by rP15375. How about displayLocked = state.gate.locked to avoid the clone? (primitives are copied instead of referenced) If so, GATE_ACTIONS seems worth to delete, especially when looking how the only place that uses it, uses it. (If we want such a thing, it should contain filenames)
Comment Actions data.neededResources, does that mean in some mods it costs resources every time you open or close a gate?
Comment Actions That is much easier to comprehend!
Comment Actions I think the issue we had was from calling GetEntityState() through the GUI Interface. Unless you're selecting a stupid amount of entities, I don't believe it'd matter in this case (then again, checking never hurts). Comment Actions For 100 entities, took 0ms or occasionally 1ms. Alert does some() three times, that's where I got the idea. Comment Actions Ah, that was rP18773. (That added a lot of overhead as it requested the extended entity state of all entities to determine whether an action is possible whereas before it only looked for the first selected entity, which can change easily depending on the selection order.)
A cpu cycle consumes more than 0. We have Engine.GetMicroseconds(); for a higher precision. I don't know, I got a complaint once for doing two loops where one is sufficient. Someone else said it's ok because O(n) + O(n) = O(n). Comment Actions (Well my working copy is empty and I was curious.) Not sure how you got to 1ms, it consumes < 10 microseconds on my end. Thanks for the fix and the wonderful cleanup! Comment Actions I have an old computer, plus I said "occasionally". :) Fluctuates but maybe 25 microseconds with the patch, 15 with a loop, with 200 entities. Thanks for the suggestions and review. Comment Actions (Also there are many more possible performance optimizations. For instance Im not sure if creating an array in getItems and then parsing that in setupButton is better than doing both in the same function and updating the GUI objects directly.)
Comment Actions (Also I may not claim readability, but the formula is now in Prenex normal form following the !some to every change, so yay.) Comment Actions The three some calls come from rP18773 (last time I checked). |