Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Cast issue on IObjectPlayerSpawnTrigger

Here you can find all solved gameplay problems and bugs (beginning from Pre-Alpha 1.8.8).
Forum rules
By using the forum you agree to the following rules. For this forum you also need to follow these additional rules.
Locked
User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Cast issue on IObjectPlayerSpawnTrigger

Post by JakSparro98 » Sun Apr 05, 2020 6:51 pm

When populating the melee item field with SetSpawnWeaponItemMelee() it will later throw a cast error when calling Trigger().

Code: Select all

public void OnStartup()
{
IObjectPlayerSpawnTrigger spawn= (IObjectPlayerSpawnTrigger )Game.CreateObject("PlayerSpawnTrigger");
spawn.SetSpawnWeaponItemMelee(WeaponItem.NONE);
spawn.Trigger();
}
1 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Sun Apr 26, 2020 12:36 pm

Fixed after v.1.3.5.
0 x
Gurt

Locked