Page 1 of 1

IGame.SpawnProjectile() not working when called in callbacks from ProjectileCreatedCallback

Posted: Sun Apr 05, 2020 6:36 pm
by NearHuscarl
Minimal sample code

Code: Select all

public void OnStartup()
{
	Game.SpawnProjectile(ProjectileItem.BAZOOKA, Vector2.Zero, Vector2.Zero); // works
	Events.ProjectileCreatedCallback.Start((p) =>
	{
		Game.SpawnProjectile(ProjectileItem.BAZOOKA, Vector2.Zero, Vector2.Zero); // not working
	});
}

Re: IGame.SpawnProjectile() not working when called in callbacks from ProjectileCreatedCallback

Posted: Mon Apr 06, 2020 10:55 pm
by Gurt
Woop! Those projectiles are now in the void. Fixed after v.1.3.5 which will trigger the ProjectileCreatedCallback to be run next update instead of current update in case you call it inside ProjectileCreatedCallback.