StrataSource / Portal-2-Community-Edition

Task tracker for Portal 2: Community Edition
https://www.portal2communityedition.com
148 stars 3 forks source link

trigger_autosave is deleted on spawn #1480

Closed vrad-exe closed 1 year ago

vrad-exe commented 1 year ago

Describe the bug

trigger_autosave entities appear to get deleted on spawn, as they do not work and do not show up with showtriggers. The entity still appears to exist as it appears in dumpentityfactories and there are no unknown entity errors in the console. logic_autosave also appears to still work fine.

Issue Map

Any map with trigger_autosaves, for example sp_a2_bts1.

To Reproduce

Using sp_a2_bts1 as an example:

  1. Load the map
  2. Progress normally until wheatley turns off the lights, enter noclip before you reach the floor
  3. There should be a trigger_autosave on the floor, but in P2CE there isn't

P2CE: chaos_Ym6vYOMkWG

Portal 2: portal2_M9sOWjASlZ

The same applies for any other place there would normally be a trigger_autosave

Operating System

No response

MyGamepedia commented 1 year ago

I was wondering why saves don't work in Half Life 2 maps... I test this in my P2CE mod and found that it's can be saved thanks point_template, but this bug should be fixed because of compatibility. Isn't should be moved to Engine ? Momentum Mod should have this thing.

vrad-exe commented 1 year ago

Momentum doesn't implement saving, they probably don't even have this entity

ozxybox commented 1 year ago

Erin has fixed this, should be on the staging branch tonight

vrad-exe commented 1 year ago

What was the issue, was it literally just removing itself?

ozxybox commented 1 year ago

Yeah, I think it was because the player didn’t exist by the time it spawned so it would remove itself or something like that

AWildErin commented 1 year ago

@Luke18033 it was checking to see if saving was allowed upon spawn, but we changed some logic to that function as the player wouldn't exist at that time and would cause crashes in other parts of the code. This inadvertently affected this entity too, so I just changed to check if we can save upon touch which will work for p2ce fine.