- Joined
- Apr 28, 2008
- Messages
- 76
What is wrong with this code?
BattleSystem.wurst
Summoner.wurst
But when I call new Summoner() more than once it causes an error.
"Trying to assign entity to unit that already has an entity"
But I do not understand, because every time createUnit(p, unitId, pos, facing) was called it should be a new instance.
BattleSystem.wurst
Wurst:
package BattleSystem
import Entity
public abstract class BattleUnit extends UnitEntity
construct(player p, int unitId, vec2 pos, angle facing)
super(createUnit(p, unitId, pos, facing))
Summoner.wurst
Wurst:
package Summoner
import BattleSystem
public class Summoner extends BattleUnit
construct(player p, vec2 pos, angle facing)
super(p, SUMMONER_ID, pos, facing)
But when I call new Summoner() more than once it causes an error.
"Trying to assign entity to unit that already has an entity"
But I do not understand, because every time createUnit(p, unitId, pos, facing) was called it should be a new instance.