I have been reading the TPT source code for portals lately, but I've been unable to figure out how particles are stored in PRTI before PRTO is created. How is PRTI able to store particles of all types? I would also specifically like to know how the "portalp" table works.
It stores them in a internal array https://github.com/ThePowderToy/The-Powder-Toy/blob/44a8665f6f9f6cb8cba67a5a1acd2f09b446ed73/src/simulation/elements/PRTI.cpp#L103