Commit Graph

54 Commits

Author SHA1 Message Date
march
4fe6b1983d Add CFW_OnParentedTo 2025-01-11 21:16:40 -08:00
thecraftianman
f7d5e0b265 Add Adv. Ballsocket to constraint list 2024-08-28 20:51:31 -04:00
thecraftianman
6f8480bdd2 Adjust children placement 2024-08-27 22:56:26 -04:00
thecraftianman
1a4803067b Implement ENT:GetFamilyChildren + add mass for families 2024-08-27 15:07:42 -04:00
TwistedTail
c1ab687176 Changed some namespace names to pascal case 2024-07-15 19:44:19 -04:00
TwistedTail
e140a608df Switched file loaders, using gLoader now
- Old loader was seemingly not sending the files to the correct realms on single player.
2024-07-15 19:37:25 -04:00
TwistedTail
a546e7c981 Avoid iterating through links if empty
- Since ENT:GetLinks will always return a table, we'll avoid iterating through it if it's empty.
2024-07-15 19:14:52 -04:00
TwistedTail
1f818733f8 Fixed annoying missing ENT._links table error 2024-06-23 03:52:43 -04:00
TwistedTail
0a31f7e20c Added an extra check to ENT:GetLinks()
- In some cases, you could use ENT:GetLinks() on entities that were never linked before, now we'll make sure that's the case before copying that table.
2024-06-23 03:52:18 -04:00
TwistedTail
2aafe1b6b6 Added a connection check before attempting to disconnect
- CFW.disconnect will now actually check if both entities are connected before doing anything.
2024-06-23 03:51:14 -04:00
thecraftianman
839af48129 Exclude parented nextbots 2024-06-22 15:35:39 -04:00
thecraftianman
4ef05dc203 Don't track parented NPCs either 2024-06-14 21:43:39 -04:00
LiddulBOFH
cea75d5f7e Prevent tracking links that only connect an entity to itself
No reason to link an entity to itself, also prevents an error
Most prominently this occurred from constraining a ragdoll to itself
2024-06-10 11:27:44 -05:00
LiddulBOFH
325278517e Tentative fix for nil _links table, new tool
A potential fix for floodfill in connectivity_sv erroring when running through an entity's _links table, due to said table being set to nil if the last link in that table happened to be removed

Also new tool (to be fleshed out later) to aid in seeing an entity's connections in various manners for CFW. Right now it requires 'developer 1' due to usage of debugoverlay, later an overlay can be made alongside networking for CFW info. Due to that requirement, the tool will not be listed in the menu and must be accessed alternatively, such as 'gmod_tool cfw_tool'
2024-06-10 10:44:55 -05:00
thecraftianman
7331e604be Do not manage parented players in contraptions 2024-06-03 14:16:46 -04:00
LiddulBOFH
69e11a6169 Update E2 function
Change what the function is marked to return to what it is actually returning
Previously was returning a contraption object that just wasn't valid to instead represent the collection of entities it is supposed to
2024-05-31 22:01:11 -05:00
thecraftianman
8d17b0dbdd Add linter 2024-05-16 13:32:23 -04:00
thecraftianman
657993c026 Prevent parenting to self
Possible fix for #7
2024-04-19 16:29:40 -04:00
thecraftianman
f91bcd8c43 Add parenting detour functions
This merges the parenting detour functionality originally from ACF-3 into CFW directly.
2024-04-18 17:36:55 -04:00
Matt
430d10e2a2 Account for parents not created by the multi parent tool
The workshop's multi parent detours GetChildren in a weird way - fixes https://github.com/ACF-Team/CFW/issues/5
2024-03-20 15:26:22 -04:00
thecraftianman
8c6ffef160 Validate ent when adding/removing mass 2024-01-10 14:04:27 -05:00
thecraftianman
c5b762f9b7 Update E2 library
Removed deprecated operators + added function descriptions
2023-10-25 22:46:02 -04:00
thecraftianman
6229d41c59 Revert "Fix missing link error"
This reverts commit 34fe7a090b.
2023-09-15 13:39:47 -04:00
thecraftianman
34fe7a090b Fix missing link error
Fixes the error
`[cfw] addons/cfw/lua/cfw/core/connectivity_sv.lua:65: attempt to index local 'link' (a nil value)
  1. disconnect - addons/cfw/lua/cfw/core/connectivity_sv.lua:65
   2. SetParent - addons/cfw/lua/cfw/core/parenting_sv.lua:24
    3. Function - lua/autorun/parent_childtables.lua:25
     4. fn - lua/includes/extensions/entity.lua:146
      5. unknown - addons/ulib-master/lua/ulib/shared/hook.lua:109`
2023-09-14 15:47:13 -04:00
thecraftianman
ce05dec332 Fix some linter complaints 2023-09-14 13:55:04 -04:00
thecraftianman
621a39d4a9 Fix stack overflow
This can occur with certain E2 chips like MPFC
2023-09-14 13:50:41 -04:00
Stoob
0b864db33f Added CFW_NO_FAMILY_TRAVERSAL flag
Adding CFW_NO_FAMILY_TRAVERSAL to an entity will prevent families from spreading through itself. It will always be the root, even if parented to something else.
2023-07-17 20:52:44 -05:00
Stoob
85110e5502 Families WIP 2 2023-07-17 20:25:51 -05:00
Stee
aa42d89fb2 Families WIP 2023-02-15 23:34:14 -06:00
Stoob
30fda3f73a Elastics workaround; Fixed links being emptied
- Fixed ent._links getting emptied during flood fill
- Changed link storage to circumvent elastics bug

Elastics, and potentially other things, sometimes have `NULL` on `Ent1` or `Ent2`. To get around this, constraints store the indecii of their ents and ents store links in index, link pairs.
Constraints pass the stored entIndex to `CFW.disconnect`. `CFW.disconnect` now takes `ent, otherEntIndex` args
2022-11-18 01:28:27 -06:00
Stoob
cc9e4d6477 Removed straggler 2022-10-05 00:12:10 -05:00
Stoob
7e111a408d Style 2022-10-05 00:10:25 -05:00
Stoob
46eae73f30 Fixed erroneous dirty breaks 2022-10-05 00:09:45 -05:00
Stoob
b51948d0b4 HUGE! 2022-10-05 00:07:20 -05:00
Stoob
e68bce4779 Bugfix 2022-10-05 00:07:08 -05:00
Stoob
171e84d926 Notes 2022-10-04 23:21:10 -05:00
Stoob
bb22bba6ca Removed usage of GetLink(s) 2022-10-04 23:20:54 -05:00
Stoob
3e1be4f384 Added CFW.parentFilter lookup table 2022-10-04 23:20:13 -05:00
Matt
08cc1e2eda Check that undo.Entities exists 2022-09-30 15:44:32 -04:00
Stoob
c6e015fd62 Fixed mass error on ents added to a contraption without a physObj
Handles cases of entities being added to a contraption before they have a physObj, then acquire one, and have their mass changed.
2022-07-25 17:40:59 -05:00
Stoob
5b9c9dd59b Removed test hook from position extension 2022-07-18 16:49:11 -05:00
Stoob
9c3bea1064 Added contraption:Defuse()
Allows for the safe removal of a contraption, particularly when an error occurs.
2022-07-18 16:48:10 -05:00
Stoob
2928dcc50c Fixed link error on player disconnect 2022-07-18 16:45:10 -05:00
Stoob
07b7a22b24 Added safety net in constraint removal w/ debug output
Instead of erroring and breaking, safely error and delete the contraption.
2022-07-14 17:17:04 -05:00
Stoob
9cc1d0e6ea Added validity check to constraints
Garry moment. The man doesn't clean up his constraint tables.
2022-07-14 15:27:16 -05:00
Stoob
23af343411 Removed debugging colors 2022-07-12 16:14:02 -05:00
Stoob
3583daf8b9 Optimized contraption splits
Contraptions now move the least amount of ents between a parent and child contraption during a split
Added cfw.contraption.split hook
2022-07-06 23:43:16 -05:00
Stoob
d5715df53b Further improved undo handling
Gotta pump those commit numbers

Now it'll take care of all entities, including those not in the dupe, such as holograms.
2022-07-06 18:21:11 -05:00
Stoob
cd2367928d Improved Undo handling
Fixed handling parented entities
2022-07-06 15:13:52 -05:00
Stoob
b8a1de5c37 Added support for E2 2022-07-06 13:15:34 -05:00