Commit Graph

56 Commits

Author SHA1 Message Date
Jeija
194155fff8 Rewrite mesecon wires. This should increase the efficiency and speed of
large machines.

It also makes the wires.lua code easier to understand and more
maintainable. In case any other mod depends on
mesecon:update_autoconnect, please update it to use
mesecon.update_autoconnect. This should also fix some other minor bugs.
Please report bugs if this commit creates new ones.

This commit changes wire looks and removes some unneccesary textures.
2014-11-22 11:40:58 +01:00
Jeija
1b9f1b8c13 Fix #182, bug when placing wire crossings next to a powered source
In case this fix creates new bugs, please report them.
2014-11-21 22:05:35 +01:00
Jeija
e5896076fe Make sure #160 cannot be exploited to make servers crash.
This is not exactly a fix for the issue, because extremely
large circuits (3000+ conductors) still won't work with this applied.
This simply aborts any execution if there is the danger of a stack overflow.
2014-06-01 11:00:39 +02:00
Jeija
300abcb587 Fix #155 (option 2 used). Remove non-ActionQueue system. Enable overheat for more than 20 actions per second on lua- / microcontrollers and gates.
Fix a bug where a burnt luacontroller didn't have the correct pin-states as the burnt controller does not register any changes from outside.
2014-04-20 21:51:17 +02:00
Jeija
2cab6aa5ef Merge pull request #134 from Novatux/master
Fix a few bugs that caused effectors not to turn off sometimes
2014-03-20 09:28:03 +01:00
Jeija
a632a8abc8 Fix delayers and disable resuming if not using MESECONS_GLOBALSTEP 2014-01-19 13:57:11 +01:00
Jeija
1a492feb7a Turnon/turnoff overwritable 2014-01-11 18:31:30 +01:00
Jeija
d066b91632 Fix infinite priority bug in mesecon:turnoff, thanks to Novatux 2014-01-11 16:48:25 +01:00
Jeija
1083539e9b Resume turnon/off calls as soon as area is loaded in case turnon/off calls end in unloaded territory 2014-01-11 16:46:27 +01:00
Jeija
f1211f7dae Add ActionQueue priority system
This makes effectors nearer to the source of the action (the receptor) update first.

This defines behaviour for this piston circuit: http://i.imgur.com/9Pp2Mzb.png
And defines, that this memory circuit does not work from this direction: http://i.imgur.com/jJn0aFh.png
But it will work when using the switch from the other side: http://i.imgur.com/nvw0oZB.png

Only if two effectors have the same distance, there is nothing we can do about it, behaviour is not defined.
"Distance" is determined by the stack size of recursions in turnon / turnoff.
Priorities are between 0 (lowest) and 1 (highest).
2014-01-11 14:57:56 +01:00
Jeija
2d004b19ea First draft of some kind of Action Queue (just like the globalstep queue in to_update), but more flexible and also including delay functionality (mesecon_delayer).
The queue is also saved to a file, so that when restarting mesecons, delayers resume to the state they had when the game shut down. Needs testing.
2014-01-10 22:33:40 +01:00
Novatux
5e02b3beef Fix a few bugs that caused effectors not to turn off sometimes (rules_link is evil!) 2014-01-05 13:51:09 +01:00
Novatux
9c2a5c313c Use swap_node instead of add_node when replacing conductors. 2014-01-05 09:52:06 +01:00
Novatux
fb417d45a7 Fix when there are several rules with different specials 2014-01-04 17:22:04 +01:00
Novatux
ae557d1cd4 Fixes with multi-conductors that have special connects 2014-01-04 15:52:52 +01:00
Novatux
d5b39951a4 Fix bugs with multi-rules conductors (like crossing) that have param2 2014-01-04 14:15:41 +01:00
Uberi
16b4b79c51 Update code to standards of Minetest 0.4.8. 2013-11-30 22:13:00 -05:00
khonkhortisan
913e355a71 Merge pull request #112 from khonkhortisan/multi_rules
Multi rules
Merged for near-future textures to be merged cleanly.
2013-08-27 22:22:30 -07:00
khonkhortisan
885899cbaf Crossover 2013-06-20 09:30:26 -07:00
khonkhortisan
4f2604e01b mesecon:rules_link nil return rule
Fixes https://github.com/Jeija/minetest-mod-mesecons/issues/108
2013-06-10 18:29:40 -07:00
Novatux
afad592783 Change mesecons signals so that they update effectors only after a globalstep, configurable to be on/off 2013-06-05 15:37:55 -04:00
Jeija
ef087f2bb6 Fix Bug: Wrong usage of action_on/action_off instead of action_change 2013-01-19 23:37:03 +01:00
Jeija
7e231b99a6 Make nr in rules rotation local in order not to pullute the holy global namespace 2012-12-28 07:33:16 +01:00
Jeija
ac0fb91139 Minor cleanup of mesecno torch and add another rule to it (behind above) 2012-12-27 10:50:20 +01:00
Jeija
7fe4947056 Bugfix foes for pistons, delayyrs, gates and microcontrollers. Rework delayers. 2012-12-27 09:28:04 +01:00
Jeija
d91e0b66cb Re-write pistons from scratch, propably fixes a lot of bugs and doesn't cause too many new ones. 2012-12-26 22:54:28 +01:00
Jeija
23bebfc054 Merge branch 'master' into nextgen
Conflicts:
	mesecons/internal.lua
	mesecons/wires.lua
	mesecons_pistons/init.lua
2012-12-21 16:22:25 +01:00
Jeija
6b1bfe6391 Add rule-name system. Every input rule can now have a name, that could help e.g. the microcontroller to know where a signal comes from. 2012-12-19 17:34:05 +01:00
Jeija
313b9adcd5 Should fix this bug: bit.ly/XEy94j 2012-12-18 15:59:23 +01:00
Jeija
c76c274cc0 Remove mesecons:updatenode 2012-12-16 12:00:11 +01:00
Jeija
a1852204fb Cleanup and improve piston code 2012-12-16 11:58:43 +01:00
Jeija
5fb5df446c Bugfix, use param2 for conductors when turning them on/off 2012-12-15 21:23:38 +01:00
Jeija
18731cbc8a Bugfix, param2 for conductors 2012-12-15 21:21:54 +01:00
Jeija
44dc1a128c Upload cleaned up mesecons to nextgen branch 2012-12-15 18:45:51 +01:00
Jeija
c0d3bd2abb Include experimental vertical wires (needs textures) 2012-12-13 18:42:45 +01:00
Jeija
de46729b97 Merge branch 'mesecons_in_nodedef'
Conflicts:
	mesecons/internal.lua
2012-12-11 19:49:55 +01:00
Jeija
5904abbd79 Port gates (finally) 2012-12-10 19:46:24 +01:00
Jeija
cf6080f723 Port more blocks to nodedef system: object detector, extrawires, water turbine, insulated wire 2012-12-08 22:28:46 +01:00
Jeija
00e071b695 Cleanup, make and use util.lua, port command block and delayer to nodedef 2012-12-08 21:56:09 +01:00
Jeija
8578fd89c8 Port lightstones (as reference for effectors) + blinky plant to the new nodedef system 2012-12-08 19:02:34 +01:00
Jeija
472650f099 Finish new mesecon-in-nodedef for conductors and receptors. Make wires and switch use it for reference. 2012-12-08 17:50:25 +01:00
Jeija
f28cf0af03 Fix major bug that often occured when using gates (caused by commit 64d109b) 2012-12-08 16:08:16 +01:00
Jeija
e0aa5b1d3d New branch: Move mesecon to node definition instead of functions like register_conductor; first steps: move everything to legacy 2012-12-08 14:14:04 +01:00
Jeija
7542dd4da0 Fix a bug (in some cases the output rules of a receptor weren't respected, bug introduced by commit before, 64d109b31b) 2012-12-03 18:59:34 +01:00
Anthony Zhang
64d109b31b mesecon:updatenode() was written to work only with conductors, though in several places it was used on recepters and effectors. This issue, reported by simion314, is fixed in this commit by explicitly checking for the type of mesecon node being updated. 2012-12-01 18:34:05 -05:00
Jeija
f959c16763 Fix Microcontroller bug (discovered by Fenris) and some others that propably noone found 2012-09-08 15:10:31 +02:00
Jeija
3928d54d0c Implement mesecon:register_receptor(onstate, offstate, rules, get_rules) and make add_receptor_node(_off) deprecated 2012-09-06 09:53:30 +02:00
Jeija
7e7e1de725 Code cleanup 2012-09-05 23:52:09 +02:00
Jeija
863ef26b63 Make isolated wires depend on facedir, rename them to 'insulated' 2012-08-17 11:59:06 +02:00
Jeija
78fdedc880 Add conductor rules, add demo isolated mesecons to proof that it works 2012-08-16 21:24:06 +02:00