Skip to content

A bug and some requests #3

@Jake-NotTheMuss

Description

@Jake-NotTheMuss

Hello, I have a bug to report and some requests.

In scripts/shared/audio_shared.csc in the function startSoundLoops(), there is an else block which encloses a devblock which encloses an if block. In the source, it looks like this:

else
{
  /#
    if( GetDvarint( "debug_audio" ) > 0 )
    {
      println( "*** Client : No looper sounds." );
    }	
  #/			
}

In the decompilation, it looks like this:

else
{
  /#
    println("");
  #/
  if(getdvarint("") > 0)
  {
  }
}

So the devblock and all the ops within it are listed before the if skeleton, and then the empty if block after

Most zm_*_amb.csc scripts have a function very similar to startSoundLoops() with this same problem, and the only other example of this that I found is in scripts/zm/zm_castle_weap_quest_upgrade.gsc, which can be seen in the images I attached.

Images showing these examples:
zm_genesis_amb_dec
zm_genesis_amb_ops
zm_castle_weap_quest_upgrade_dec
zm_castle_weap_quest_upgrade_ops

I also have some requests:

  • listing includes by their actual table order rather than sorted alphabetically. When rewriting scripts from their decompiled representations, I want to match the script as accurately as I can, including the include order. I can check the FF dumps to see the include order for a particular script, but it would be more convenient if the order was listed in the decompiled script.

  • Identify debug strings by adding enumerated placeholder names such as "Dev string 1", "Dev string 2", etc., where "Dev string n" is the nth debug string in the table, just as an example. Like with includes, this would make it more convenient to know which dev string I'm looking at rather than having to check the FF dumps. ( Also, another thing I often check is the length of a debug string, which you get from the FF dump based on offset differences in the table. Maybe in addition to enumerating them, you can put something like "Dev string 1 (length: 10 + 1)" where the string has 10 characters plus a null byte, for example, and then the last dev string would be "Dev string n ( last string, unknown length )" )

  • Including code after unconditional returns ( or maybe this is a bug, but an example of this is in scripts/shared/_character_customization.csc in the function handle_forced_streaming(), which returns immediately but still has code after the return. Another example is in scripts/zm/_util.gsc in getOtherTeam(), where the function returns unconditionally and then has an assertmsg after.

Any of these changes would be a big help with what I use these scripts for.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions