You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 17, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 17, 2022. It is now read-only.
keyword_sensors_teamsresolution_fixedtype_bug | by Per
This patch adds the ability of allied players to share each others' sensors. For the moment, it only works for structures by structures, but that's just how the sensor code works at the moment and I will try to fix that in a separate patch.
Since iterating over all structures by all players to see if we could use each as a sensor would be rather time consuming, I created a new set of lists (currently with only one member) that sorts objects by function. This way we can very quickly iterate over all sensors, even when there are several hundred buildings on the map. The implementation of this is rather bug prone, since it is not type safe, but it is as good as it gets without a major rewrite or porting to C++, I think.
TODO: New list code needs testing to see if it crashes somewhere in campaign, since that does a lot of funky things to the lists code.
Issue migrated from trac:636 at 2022-04-15 18:54:18 -0700
Why only for locked teams? I'm not sure about changing all asserts to assert_or_return - sometimes the extra conditional is not really worth it, but I'll look into this one.
New version of the patch. It fixes a few bugs, and generalizes the code to be utilized also for droids. Currently this support for droids has little effect, however, due to a number of bugs in the action code that I do not want to fix in this patch.
It works the other way, though. You can take a sensor droid for a walk, point at interesting enemy structures, and sit back to watch the archangel missile battery fireworks.
(In [7765]) Add the ability of allied players to share each others' sensors. Since iterating over all structures
by all players to see if we could use each as a sensor would be rather time consuming, I created a
new set of lists (currently with only one member) that sorts objects by function. This way we can
very quickly iterate over all sensors, even when there are several hundred buildings on the map.
Closes #636.
Activity
wzdev-ci commentedon Jun 15, 2009
Per uploaded file
sharedsensor.diff(11.9 KiB)wzdev-ci commentedon Jun 15, 2009
Buginator commented
Will this only be used for locked teams?
Also, if this fails: ASSERT(object != NULL, "Invalid pointer");
We will crash in a release build. Perhaps change that to ASSERT_OR_RETURN?
Oh, and you might want to add a assert check to make sure player is in range?
wzdev-ci commentedon Jun 17, 2009
Per changed status from
newtoacceptedwzdev-ci commentedon Jun 17, 2009
Per changed owner from `` to
Perwzdev-ci commentedon Jun 17, 2009
Per commented
Why only for locked teams? I'm not sure about changing all asserts to assert_or_return - sometimes the extra conditional is not really worth it, but I'll look into this one.
wzdev-ci commentedon Jun 17, 2009
Per commented
New version of the patch. It fixes a few bugs, and generalizes the code to be utilized also for droids. Currently this support for droids has little effect, however, due to a number of bugs in the action code that I do not want to fix in this patch.
It works the other way, though. You can take a sensor droid for a walk, point at interesting enemy structures, and sit back to watch the archangel missile battery fireworks.
wzdev-ci commentedon Jun 17, 2009
Per uploaded file
sharedsensor2b.diff(19.1 KiB)wzdev-ci commentedon Jun 17, 2009
Per uploaded file
sharedsensor2c.diff(19.1 KiB)Fixed a bug that showed up during mission testing.
wzdev-ci commentedon Jun 17, 2009
Per set resolution to
fixedwzdev-ci commentedon Jun 17, 2009
Per changed status from
acceptedtoclosedwzdev-ci commentedon Jun 17, 2009
Per commented
(In [7765]) Add the ability of allied players to share each others' sensors. Since iterating over all structures
by all players to see if we could use each as a sensor would be rather time consuming, I created a
new set of lists (currently with only one member) that sorts objects by function. This way we can
very quickly iterate over all sensors, even when there are several hundred buildings on the map.
Closes #636.