View Single Post
  #1  
Old 05-21-2005, 08:25 PM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
GS2: Problems with (client*) String Lists

Well, I've got two bugs here and as I am bad at describing stuff, I guess it'd be the best to make examples.

1. Increment/Decrement operators
When using -- or ++ on a client* String List the Value doesn't get saved, the script after it does know of the change though.
Example:
HTML Code:
function onWeaponFired() {
  player.client.foo = "10,20,30";
  player.client.foo[1] --;
  player.chat = player.client.foo[1];
}
Will show you the value you would've expected, but when you look at the player attributes you see the client.foo string is still "10,20,30".

2. client* String Lists aren't beeing updated correctly
If you executed the previous code multiple times you might've noticed that every time you fire the weapon, player.client.foo[1] actually decreases by one, so first its 19, then 18 and so on... even though the value has been set before.
EDIT: This bug seems to be associated with --/++ as it only happens when using them. Works fine with -= 1;

I hope you understand it, the best thing would be to use that example, it should become obvious then.
I tried this code both clientside and serverside with the same results.
__________________
Graal Statistics

Top 3 servers at the moment (players):


Reply With Quote