Skip to content

RefreshEntities

This method performs some reset on some entity fields. It belongs to MainManager.

public static void RefreshEntities(bool forceanim, bool refreshmap, bool onlyplayer)

Parameters:

  • forceanim: Tells if ForceAnim will be called on each entity which will call Play on the entity's anim using its the current animstate (f is appended if the entity's height is aboe 0.1 and it has the same meaning than its normal argument)
  • refreshmap: Tells if the NPCControl specific logic will apply
  • onlyplayer: Tells if only the playerdata entities part will have their fields reset

There are 3 overloads: one where onlyplayer is ommited and false is sent, one without parameter where all the parameters will have false sent and one where the only parameter is onlyplayer and the other 2 will have false sent.

Procedure

  • All playerdata entities have their hitwall set to false and their animid set to their corresponding BattleData.animid. If forceanim is true, ForceAnim is called which will call Play on the entity's anim using its the current animstate (f is appended if the entity's height is aboe 0.1 and it has the same meaning than its normal argument). Finally, all player party members gets UpdateSpriteMat called on their entity which updates their sprite material according to their hologram
  • We return immediately if onlyplayer is true
  • All EntityControl have the following happen:
  • oldid is set to -1
  • oldstate is set to -1
  • emoticoncooldown is set to 0.0
  • hitwall is set to false
  • If height is above 0.1, oldfly is set to flyinganim
  • If it's an item entity, UpdateItem is called
  • If forceanim is true, ForceAnim is called which will call Play on the entity's anim using its the current animstate (f is appended if the entity's height is aboe 0.1 and it has the same meaning than its normal argument)
  • If refreshmap is true and the entity has an npcdata, further logic are done about the corresponding NPCControl for the following:
  • If refreshmap is true and the map exists, all TrailRenderer has Clear called on them which clears all the wind trails currently active